# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
975623 | vjudge1 | 별들과 삼각형 (IZhO11_triangle) | C++17 | 375 ms | 9224 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second
#define pll pair<ll, ll>
#define v(a) vector<a>
int main(){
ll n; cin >> n;
map<ll, ll> x, y;
v(pll) arr(n);
for(int i = 0; i < n; i++){
cin >> arr[i].F >> arr[i].S;
x[arr[i].F]++; y[arr[i].S]++;
}
ll ans = 0;
for(int i = 0; i < n; i++){
ll xx = x[arr[i].F]-1, yy = y[arr[i].S]-1;
ans += (xx*yy);
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |