# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1219528 | theiulius | 별들과 삼각형 (IZhO11_triangle) | C++20 | 463 ms | 20132 KiB |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define ff first
#define ss second
#define pb push_back
int n;
const int N = 2e5+5;
main(){
/*ifstream cin(".in");
ofstream cout(".out");*/
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> n;
map<int, vector<int>> xs, ys;
int x[n] = {}, y[n] = {};
for (int i = 0; i < n; i++){
cin >> x[i] >> y[i];
xs[y[i]].pb(x[i]);
ys[x[i]].pb(y[i]);
}
int ans = 0;
for (int i = 0; i < n; i++){
ans += (xs[y[i]].size() - 1) * (ys[x[i]].size() - 1);
}
cout << ans << endl;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |