답안 #142546

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
142546 2019-08-09T13:59:29 Z vardan__02 별들과 삼각형 (IZhO11_triangle) C++14
0 / 100
2 ms 376 KB
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <deque>
#include <cstring>
#include <string>
#include <set>
#define ll long long
#define ld long double
using namespace std;
ll i, j, n, m, k, p, q, a[300005], b[300005], x[300005], y[300005];
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> a[i] >> b[i];
		x[a[i]]++;
		y[b[i]]++;
	}
	for (i = 1; i <= n; i++)
		m += (x[a[i]] - 1)*(y[b[i]] - 1);
	cout << m << endl;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Incorrect 2 ms 376 KB Output isn't correct
6 Halted 0 ms 0 KB -