# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
975093 | 2024-05-04T12:33:34 Z | Amaarsaa | 별들과 삼각형 (IZhO11_triangle) | C++14 | 247 ms | 15028 KB |
#include<bits/stdc++.h> using namespace std; using ll = long long ; map < int,int > X, Y; int main() { // freopen("moocast.in", "r", stdin); // freopen("moocast.out", "w", stdout); ios::sync_with_stdio(false); cin.tie(NULL); ll t, n, m, ans, s, sum, r, p, i, j; cin >> n; ll x[n + 2], y[n + 2]; for (i = 1; i <= n; i ++) { cin >> x[i] >> y[i]; X[x[i]] ++; Y[y[i]] ++; } ans = 0; for (i = 1; i <= n; i ++) { s = (X[x[i]] - 1) * (Y[y[i]] - 1); ans += s; } cout << ans << endl; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 1 ms | 344 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 456 KB | Output is correct |
8 | Correct | 0 ms | 456 KB | Output is correct |
9 | Correct | 0 ms | 344 KB | Output is correct |
10 | Correct | 1 ms | 456 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 5 ms | 1116 KB | Output is correct |
13 | Correct | 5 ms | 1288 KB | Output is correct |
14 | Correct | 7 ms | 1628 KB | Output is correct |
15 | Correct | 87 ms | 7204 KB | Output is correct |
16 | Correct | 87 ms | 7256 KB | Output is correct |
17 | Correct | 82 ms | 7068 KB | Output is correct |
18 | Correct | 83 ms | 6992 KB | Output is correct |
19 | Correct | 226 ms | 13828 KB | Output is correct |
20 | Correct | 161 ms | 10796 KB | Output is correct |
21 | Correct | 244 ms | 14644 KB | Output is correct |
22 | Correct | 247 ms | 15028 KB | Output is correct |