답안 #336088

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
336088 2020-12-14T17:20:54 Z tevdore 별들과 삼각형 (IZhO11_triangle) C++14
100 / 100
636 ms 6180 KB
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 3e5 + 10;
int n;
int x[N], y[N];
map < int, int > f1, f2;
ll ans;
main() {
	cin >> n;
	for(int i = 1; i <= n; i++) {
		cin >> x[i] >> y[i];
		f1[x[i]]++;
		f2[y[i]]++;
	}
	for(int i = 1; i <= n; i++) ans += (ll)(f1[x[i]] - 1) * (f2[y[i]] - 1);
	cout << ans << "\n";
}

Compilation message

triangle.cpp:9:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    9 | main() {
      |      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 2 ms 364 KB Output is correct
12 Correct 12 ms 876 KB Output is correct
13 Correct 13 ms 876 KB Output is correct
14 Correct 23 ms 1260 KB Output is correct
15 Correct 201 ms 4076 KB Output is correct
16 Correct 230 ms 4204 KB Output is correct
17 Correct 206 ms 4076 KB Output is correct
18 Correct 194 ms 4128 KB Output is correct
19 Correct 585 ms 5996 KB Output is correct
20 Correct 409 ms 5228 KB Output is correct
21 Correct 636 ms 6084 KB Output is correct
22 Correct 618 ms 6180 KB Output is correct