# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
166002 | 2019-11-30T06:09:44 Z | Dovran | Star triangles (IZhO11_triangle) | C++11 | 2 ms | 376 KB |
#include <bits/stdc++.h> #define N 400009 #define ff first #define ss second #define pb push_back #define ll long long #define pii pair <ll, ll> using namespace std; ll n, ans; map<ll, ll>a, b; pii p[N]; int main(){ cin>>n; for(int i=1; i<=n; i++) cin>>p[i].ff>>p[i].ss, a[p[i].ff]++, b[p[i].ss]++; for(int i=1; i<=n; i++) ans+=max(a[p[i].ff]-1, b[p[i].ss]-1); cout<<ans; }
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |