# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
884789 | 2023-12-08T12:17:23 Z | Isam | 별들과 삼각형 (IZhO11_triangle) | C++17 | 238 ms | 12260 KB |
#include<bits/stdc++.h> #ifdef DEBUG #include "debug.h" #else #define debug(...) void(37) #endif using namespace std; signed main(){ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int N; cin >> N; map<int, int> X, Y; vector<pair<int, int>> A(N); for(register int i = 0; i < N; ++i){ cin >> A[i].first >> A[i].second; X[A[i].first]++, Y[A[i].second]++; } long long ans(0); for(register int i = 0; i < N; ++i){ ans += 1ll * (X[A[i].first] - 1) * (Y[A[i].second] - 1); } cout << ans << '\n'; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 460 KB | Output is correct |
10 | Correct | 1 ms | 348 KB | Output is correct |
11 | Correct | 1 ms | 468 KB | Output is correct |
12 | Correct | 5 ms | 1116 KB | Output is correct |
13 | Correct | 5 ms | 1116 KB | Output is correct |
14 | Correct | 8 ms | 1392 KB | Output is correct |
15 | Correct | 81 ms | 6224 KB | Output is correct |
16 | Correct | 92 ms | 6548 KB | Output is correct |
17 | Correct | 87 ms | 6188 KB | Output is correct |
18 | Correct | 81 ms | 6228 KB | Output is correct |
19 | Correct | 219 ms | 11600 KB | Output is correct |
20 | Correct | 157 ms | 9296 KB | Output is correct |
21 | Correct | 232 ms | 12260 KB | Output is correct |
22 | Correct | 238 ms | 12152 KB | Output is correct |