# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975583 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 236 ms | 5852 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
#define pii pair<int, int>
#define AC ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define fs first
#define sc second
#define pb push_back
int N;
map<int, int> cntx, cnty;
ll ans;
int main() {
AC
cin >> N ;
int x[N], y[N];
for(int i=0; i<N; i++){
cin >> x[i] >> y[i];
cntx[x[i]]++, cnty[y[i]]++;
}
for(int i=0; i<N; i++){
ans += (ll)(cntx[x[i]]-1)*(ll)(cnty[y[i]]-1);
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |