# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
76990 | 2018-09-19T19:26:59 Z | farukkastamonuda | 별들과 삼각형 (IZhO11_triangle) | C++14 | 186 ms | 17020 KB |
#include <bits/stdc++.h> #define li 300005 using namespace std; int n,x[li],y[li]; long long int cev; unordered_map<int,int> xx,yy; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d %d",&x[i],&y[i]); xx[x[i]]++; yy[y[i]]++; } for(int i=1;i<=n;i++){ cev+=1ll*(xx[x[i]]-1)*(yy[y[i]]-1); } printf("%lld\n",cev); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 432 KB | Output is correct |
4 | Correct | 2 ms | 548 KB | Output is correct |
5 | Correct | 2 ms | 568 KB | Output is correct |
6 | Correct | 2 ms | 580 KB | Output is correct |
7 | Correct | 2 ms | 584 KB | Output is correct |
8 | Correct | 2 ms | 636 KB | Output is correct |
9 | Correct | 3 ms | 640 KB | Output is correct |
10 | Correct | 3 ms | 648 KB | Output is correct |
11 | Correct | 2 ms | 656 KB | Output is correct |
12 | Correct | 8 ms | 1444 KB | Output is correct |
13 | Correct | 8 ms | 1472 KB | Output is correct |
14 | Correct | 25 ms | 2088 KB | Output is correct |
15 | Correct | 73 ms | 7008 KB | Output is correct |
16 | Correct | 74 ms | 9484 KB | Output is correct |
17 | Correct | 68 ms | 11500 KB | Output is correct |
18 | Correct | 68 ms | 13692 KB | Output is correct |
19 | Correct | 186 ms | 16692 KB | Output is correct |
20 | Correct | 125 ms | 16692 KB | Output is correct |
21 | Correct | 185 ms | 16908 KB | Output is correct |
22 | Correct | 175 ms | 17020 KB | Output is correct |