답안 #974848

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
974848 2024-05-04T01:49:06 Z vjudge1 별들과 삼각형 (IZhO11_triangle) C++
100 / 100
400 ms 12292 KB
#include <bits/stdc++.h>
using namespace std;
int n;
int x[300000+5],y[300000+5];
map<int,int> cntX,cntY;
int main(){
    cin>>n;
    for (int i = 0; i < n; i++)
    {
        int tempX,tempY;
        cin>>tempX>>tempY;
        x[i]=tempX;
        y[i]=tempY;
        cntX[tempX]++;
        cntY[tempY]++;
    }
    long long ans=0;
    for (int i = 0; i < n; i++)
    {
        ans+=1ll*(cntX[x[i]]-1)*(cntY[y[i]]-1);
    }
    cout<<ans;
    return 0;
    
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2484 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2392 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2396 KB Output is correct
8 Correct 1 ms 2392 KB Output is correct
9 Correct 1 ms 2496 KB Output is correct
10 Correct 1 ms 2396 KB Output is correct
11 Correct 2 ms 2396 KB Output is correct
12 Correct 9 ms 3144 KB Output is correct
13 Correct 11 ms 3164 KB Output is correct
14 Correct 13 ms 3416 KB Output is correct
15 Correct 136 ms 7764 KB Output is correct
16 Correct 143 ms 7956 KB Output is correct
17 Correct 128 ms 7592 KB Output is correct
18 Correct 126 ms 7508 KB Output is correct
19 Correct 400 ms 11488 KB Output is correct
20 Correct 257 ms 9808 KB Output is correct
21 Correct 387 ms 12292 KB Output is correct
22 Correct 394 ms 12284 KB Output is correct