# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
945399 | NourWael | 별들과 삼각형 (IZhO11_triangle) | C++17 | 256 ms | 15768 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/extc++.h>
#define int long long
using namespace std;
using namespace __gnu_pbds;
map<int,int> x,y;
signed main() {
ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
int n; cin>>n;
pair<int,int> p [n];
for(int i=0; i<n; i++) {
cin>>p[i].first>>p[i].second;
x[p[i].first]++, y[p[i].second]++;;
}
int ans = 0;
for(int i=0; i<n; i++) {
ans += (x[p[i].first]-1) * (y[p[i].second]-1);
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |