답안 #37258

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
37258 2017-12-23T06:42:05 Z Yusup01 별들과 삼각형 (IZhO11_triangle) C++14
100 / 100
679 ms 10960 KB
#include<bits/stdc++.h>
using namespace std;
long long x[300009],y[300009],jog;
int n;
map<long long,int> X,Y;
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//	freopen("triangle.in","r",stdin);
//	freopen("triangle.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++){cin>>x[i]>>y[i]; X[x[i]]++; Y[y[i]]++;}
	for(int i=1;i<=n;i++)
	{
		jog+=(X[x[i]]-1)*(Y[y[i]]-1);
	}
	cout<<jog;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 6868 KB Output is correct
2 Correct 0 ms 6868 KB Output is correct
3 Correct 0 ms 6868 KB Output is correct
4 Correct 0 ms 6868 KB Output is correct
5 Correct 0 ms 6868 KB Output is correct
6 Correct 0 ms 6868 KB Output is correct
7 Correct 0 ms 6868 KB Output is correct
8 Correct 0 ms 6868 KB Output is correct
9 Correct 0 ms 6868 KB Output is correct
10 Correct 0 ms 6868 KB Output is correct
11 Correct 0 ms 6868 KB Output is correct
12 Correct 6 ms 7396 KB Output is correct
13 Correct 6 ms 7396 KB Output is correct
14 Correct 16 ms 7924 KB Output is correct
15 Correct 196 ms 10696 KB Output is correct
16 Correct 213 ms 10828 KB Output is correct
17 Correct 183 ms 10696 KB Output is correct
18 Correct 196 ms 10696 KB Output is correct
19 Correct 569 ms 10960 KB Output is correct
20 Correct 396 ms 10960 KB Output is correct
21 Correct 606 ms 10960 KB Output is correct
22 Correct 679 ms 10960 KB Output is correct