# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
671594 | 2022-12-13T09:12:38 Z | Cutebol | 별들과 삼각형 (IZhO11_triangle) | C++17 | 275 ms | 9084 KB |
#include <bits/stdc++.h> using namespace std; void fopn(string name){freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout);} #define Xiao ios_base::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0); #define int long long #define endl "\n" #define ff first #define ss second const int N = 3e5 + 5 ; const int mod = 1e9 + 7 ; const int inf = 1e18 ; int n ; int x[N] , y[N] ; map <int , int> mpx , mpy ; void solve(){ cin >> n ; for ( int i = 0 ; i < n ; i ++ ){ int xx, yx ; cin >> x[i] >> y[i] ; mpx[x[i]] ++ ; mpy[y[i]] ++ ; } int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ){ ans += (mpx[x[i]]-1)*(mpy[y[i]]-1) ; } cout << ans ; } signed main(){ Xiao ; int t = 1 ; // cin >> t ; while ( t -- ) solve() ; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 340 KB | Output is correct |
8 | Correct | 0 ms | 340 KB | Output is correct |
9 | Correct | 1 ms | 340 KB | Output is correct |
10 | Correct | 1 ms | 340 KB | Output is correct |
11 | Correct | 1 ms | 340 KB | Output is correct |
12 | Correct | 5 ms | 1108 KB | Output is correct |
13 | Correct | 5 ms | 1108 KB | Output is correct |
14 | Correct | 9 ms | 1472 KB | Output is correct |
15 | Correct | 102 ms | 5764 KB | Output is correct |
16 | Correct | 105 ms | 5868 KB | Output is correct |
17 | Correct | 94 ms | 5744 KB | Output is correct |
18 | Correct | 101 ms | 5692 KB | Output is correct |
19 | Correct | 260 ms | 8764 KB | Output is correct |
20 | Correct | 200 ms | 7616 KB | Output is correct |
21 | Correct | 272 ms | 9084 KB | Output is correct |
22 | Correct | 275 ms | 9080 KB | Output is correct |