# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
593296 | 2022-07-10T19:42:32 Z | Summers | 별들과 삼각형 (IZhO11_triangle) | C++14 | 113 ms | 14148 KB |
#include<bits/stdc++.h> #include<unordered_map> #define endl '\n' using namespace std; long long a[1000000], b[1000000]; unordered_map<long long,long long>mp,mp2; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long i,j,k,br=0,n; cin>>n; for(i=0;i<n;i++) { cin>>a[i]>>b[i]; mp[a[i]]++; mp2[b[i]]++; } for(i=0;i<n;i++) { br+=(mp[a[i]]-1)*(mp2[b[i]]-1); } cout<<br<<endl; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 332 KB | Output is correct |
7 | Correct | 1 ms | 340 KB | Output is correct |
8 | Correct | 1 ms | 340 KB | Output is correct |
9 | Correct | 1 ms | 340 KB | Output is correct |
10 | Correct | 1 ms | 340 KB | Output is correct |
11 | Correct | 1 ms | 340 KB | Output is correct |
12 | Correct | 5 ms | 980 KB | Output is correct |
13 | Correct | 4 ms | 992 KB | Output is correct |
14 | Correct | 5 ms | 1364 KB | Output is correct |
15 | Correct | 37 ms | 6644 KB | Output is correct |
16 | Correct | 40 ms | 6920 KB | Output is correct |
17 | Correct | 38 ms | 6660 KB | Output is correct |
18 | Correct | 37 ms | 6660 KB | Output is correct |
19 | Correct | 100 ms | 13344 KB | Output is correct |
20 | Correct | 67 ms | 10408 KB | Output is correct |
21 | Correct | 103 ms | 14080 KB | Output is correct |
22 | Correct | 113 ms | 14148 KB | Output is correct |