# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
521900 | Ronin13 | 별들과 삼각형 (IZhO11_triangle) | C++14 | 305 ms | 13340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define pb push_back
#define epb emplace_back
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define inf 1e9+1
#define linf 1e18+1
using namespace std;
int dp[100001][101];
map<ll,ll>usedx,usedy;
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);
int n;cin>>n;
int x[n+1],y[n+1];
for(int i=1;i<=n;i++)cin>>x[i]>>y[i];
for(int i=1;i<=n;i++){
usedx[x[i]]++;
usedy[y[i]]++;
}
ll ans=0;
for(int i=1;i<=n;i++){
ans+=(usedx[x[i]]-1)*(usedy[y[i]]-1);
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |