# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1100549 | vjudge1 | 별들과 삼각형 (IZhO11_triangle) | C++14 | 113 ms | 22384 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>
#define pb push_back
#define int long long
#define S second
#define F first
#define inputt freopen("triangles.txt","r",stdin);freopen("triangles.txt","w",stdout);
#define ahah ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
const int N=1e6+7;
const int MOD=1e9+7;
int x[N],y[N];
unordered_map<int,vector<int>>mpx;
unordered_map<int,vector<int>>mpy;
signed main() {
ahah
int n;
cin >> n;
for(int i = 1 ; i <= n ; i++){
cin >> x[i] >> y[i];
mpx[x[i]].pb(y[i]);
mpy[y[i]].pb(x[i]);
}
int ans=0;
for(int i = 1 ; i <= n ; i++){
ans+=((int)mpx[x[i]].size()-1)*((int)mpy[y[i]].size()-1);
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |