# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
976335 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 254 ms | 13068 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define ll long long
#define fi first
#define se second
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define sz size
#define fr front
#define bc backn
#define pii pair<int,int>
#define all(x) x.begin() , x.end()
#define cmin(a, b) a = min(a , b)
#define cmax(a, b) a = max(a, b)
#define mems(arr , a) memset(arr , a , sizeof arr)
#define each(i , arr) for(auto &i : arr)
const int MOD = 1e9 + 7;
const int INF = 1e18;
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
t = 1;
// cin >> t;
while(t--){
int n; cin >> n;
int x[n] , y[n];
map<int , int> cntx , cnty;
for(int i = 0; i < n; i++){
cin >> x[i] >> y[i];
cntx[x[i]]++ , cnty[y[i]]++;
}
int ans = 0;
for(int i = 0; i < n; i++){
ans += (cntx[x[i]]-1) * (cnty[y[i]]-1);
}
cout << ans << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |