| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 842322 | AndriaBeridze | 별들과 삼각형 (IZhO11_triangle) | C++14 | 365 ms | 15700 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int TC = 0;
void dbg_out() {cout << endl;}
template<typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {cout << " " << H; dbg_out(T...);}
#define debug(...) {cout << "(" << #__VA_ARGS__ << "):"; dbg_out(__VA_ARGS__);}
#define IOS ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define int long long
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define add push_back
#define size(v) (int) v.size()
#define left node * 2, l, (l + r) / 2
#define right node * 2 + 1, (l + r) / 2 + 1, r
#define check() cout << "Why doesn't this stupid a** code work?" << endl;
#define inf (int) 1e18
void solve(){
map<int, int> X, Y;
int n;
cin >> n;
int x[n], y[n];
for(int i = 0; i < n; i++) cin >> x[i] >> y[i];
for(int i = 0; i < n; i++) X[x[i]]++, Y[y[i]]++;
int ans = 0;
for(int i = 0; i < n; i++){
ans += (X[x[i]] - 1) * (Y[y[i]] - 1);
}
cout << ans << endl;
}
signed main(){
int q = 1;
//cin >> q;
while(++TC <= q){
solve();
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
