| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1368817 | Newtonabc | 별들과 삼각형 (IZhO11_triangle) | C++20 | 348 ms | 8532 KiB |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
map<int,ll> mx,my;
int main(){
int n; cin>>n;
ll ans=0;
vector<pair<int,int>> qr;
for(int i=1;i<=n;i++){
int x,y; cin>>x >>y;
qr.push_back({x,y});
mx[x]++,my[y]++;
}
for(auto [x,y]:qr){
ans+=(mx[x]-1LL)*(my[y]-1LL);
}
cout<<ans;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
