# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
593297 | 2022-07-10T19:45:12 Z | daisy2 | Star triangles (IZhO11_triangle) | C++14 | 352 ms | 5304 KB |
#include<iostream> #include<algorithm> #include<unordered_map> using namespace std; int n,x[300005],y[300005]; unordered_map <long long,long long> row,col; int main() { cin>>n; for(int i=0;i<n;i++) { cin>>x[i]>>y[i]; if(!col.count(x[i])) col[x[i]]=0; if(!row.count(y[i])) row[y[i]]=0; col[x[i]]++; row[y[i]]++; } long long br=0; for(int i=0;i<n;i++) { br+=(row[y[i]]-1)*(col[x[i]]-1); } cout<<br<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 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 | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 212 KB | Output is correct |
10 | Correct | 1 ms | 340 KB | Output is correct |
11 | Correct | 1 ms | 340 KB | Output is correct |
12 | Correct | 9 ms | 724 KB | Output is correct |
13 | Correct | 10 ms | 724 KB | Output is correct |
14 | Correct | 11 ms | 1056 KB | Output is correct |
15 | Correct | 94 ms | 3668 KB | Output is correct |
16 | Correct | 104 ms | 3784 KB | Output is correct |
17 | Correct | 98 ms | 3596 KB | Output is correct |
18 | Correct | 93 ms | 3716 KB | Output is correct |
19 | Correct | 352 ms | 5192 KB | Output is correct |
20 | Correct | 196 ms | 4660 KB | Output is correct |
21 | Correct | 272 ms | 5276 KB | Output is correct |
22 | Correct | 275 ms | 5304 KB | Output is correct |