# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
972844 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 393 ms | 13820 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;
using ll = long long;
int main(){
int N; cin >> N;
vector<pair<int, int>>v(N);
map<int, ll>cntX, cntY;
for(auto &[x, y]: v){
cin >> x >> y;
cntX[x]++;
cntY[y]++;
}
ll ans = 0;
for(auto &[x, y]: v){
ans += max(0LL, (cntX[x] - 1)*(cntY[y] - 1));
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |