# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
975180 | vjudge1 | 별들과 삼각형 (IZhO11_triangle) | C++17 | 271 ms | 13788 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
typedef long double ld;
#define int long long
#define TC int t; cin >> t; for(int _=1; _<=t; _++)
#define pii pair<int, int>
#define pb push_back
#define ffl fflush(stdout)
using namespace std;
signed main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n; cin >> n;
map<int, int> mapx, mapy;
vector<pii> res;
for(int i=0; i<n; i++){
int x, y; cin >> x >> y;
mapx[x]++;
mapy[y]++;
res.pb(make_pair(x, y));
}
int ans = 0;
for(int i=0; i<n; i++){
int x = res[i].first, y = res[i].second;
int cntx = mapx[x]-1;
int cnty = mapy[y]-1;
if(cntx>0 && cnty>0){
ans+=(cntx*cnty);
}
}
cout << ans;
//cout << (4*(99*99)) + 200;
//cout << 99*99;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |