답안 #166748

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
166748 2019-12-03T15:56:18 Z Dilshod_Imomov 힘 센 거북 (IZhO11_turtle) C++17
0 / 100
21 ms 376 KB
# include <bits/stdc++.h>
//# pragma GCC optimize("Ofast")
# define pb push_back
# define ll long long
# define fi first
# define se second
# define all(vc) vc.begin(),vc.end()
# define forn(i, n) for (int i = 0; i < int(n); i++)
# define ford(i, n) for (int i = int(n) - 1; i >= 0; i--)
# define fore(i, l, r) for (int i = int(l); i < int(r); i++)
# define in freopen("input.txt", "r", stdin)
# define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
# define time cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"
  
using namespace std;
  
const ll INF = 1e18;
const int mod = 1e9 + 7;
const ll N = 1e7 + 7; 

map < ll, ll > x, y;
pair < ll, ll > p[N];
   
int main()
{      
    speed;
    ll n;
    cin >> n;
    forn( i, n ) {
        cin >> p[i].fi >> p[i].se;
        x[ p[i].fi ]++;
        y[ p[i].se ]++;
    }
    ll ans = 0;
    forn( i, n ) {
        ans += max( 0ll, x[ p[i].fi ] - 1 ) * max( 0ll, y[ p[i].se ] - 1 );
    }
    cout << ans;
    //time;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Incorrect 2 ms 376 KB Output isn't correct
4 Incorrect 2 ms 292 KB Output isn't correct
5 Incorrect 2 ms 376 KB Output isn't correct
6 Incorrect 2 ms 376 KB Output isn't correct
7 Incorrect 2 ms 376 KB Output isn't correct
8 Incorrect 2 ms 376 KB Output isn't correct
9 Incorrect 2 ms 376 KB Output isn't correct
10 Incorrect 3 ms 376 KB Output isn't correct
11 Incorrect 7 ms 376 KB Output isn't correct
12 Incorrect 18 ms 376 KB Output isn't correct
13 Incorrect 11 ms 376 KB Output isn't correct
14 Incorrect 8 ms 376 KB Output isn't correct
15 Incorrect 7 ms 376 KB Output isn't correct
16 Incorrect 16 ms 376 KB Output isn't correct
17 Incorrect 18 ms 376 KB Output isn't correct
18 Incorrect 16 ms 376 KB Output isn't correct
19 Incorrect 21 ms 376 KB Output isn't correct
20 Incorrect 18 ms 376 KB Output isn't correct