답안 #444879

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
444879 2021-07-15T17:34:56 Z JovanB 별들과 삼각형 (IZhO11_triangle) C++17
100 / 100
434 ms 13208 KB
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
 
map <int, ll> kx;
map <int, ll> ky;
int x[300005];
int y[300005];
 
int main(){
    ios_base::sync_with_stdio(false), cin.tie(0);
    cout.precision(10);
    cout << fixed;
 
    int n;
    cin >> n;
    for(int i=1; i<=n; i++){
        cin >> x[i] >> y[i];
        kx[x[i]]++, ky[y[i]]++;
    }
    ll res = 0;
    for(int i=1; i<=n; i++){
        res += (kx[x[i]]-1)*(ky[y[i]]-1);
    }
    cout << res;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 332 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 252 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 332 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 1 ms 332 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
11 Correct 1 ms 332 KB Output is correct
12 Correct 7 ms 1188 KB Output is correct
13 Correct 7 ms 1228 KB Output is correct
14 Correct 11 ms 1712 KB Output is correct
15 Correct 123 ms 7100 KB Output is correct
16 Correct 131 ms 7384 KB Output is correct
17 Correct 124 ms 7136 KB Output is correct
18 Correct 130 ms 7092 KB Output is correct
19 Correct 336 ms 12532 KB Output is correct
20 Correct 248 ms 10272 KB Output is correct
21 Correct 434 ms 13144 KB Output is correct
22 Correct 434 ms 13208 KB Output is correct