제출 #336088

#제출 시각아이디문제언어결과실행 시간메모리
336088tevdore별들과 삼각형 (IZhO11_triangle)C++14
100 / 100
636 ms6180 KiB
#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";
}

컴파일 시 표준 에러 (stderr) 메시지

triangle.cpp:9:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    9 | main() {
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...