답안 #17675

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
17675 2016-01-12T06:43:23 Z Adilkhan 별들과 삼각형 (IZhO11_triangle) C++
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

#define pb push_back
#define endl "\n"
#define mp make_pair 
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define fname ""
#define sz(x) (int)(x.size())

typedef long long ll;

using namespace std;

const ll N = (ll)(5e5) + 322;
const ll INF = (ll)(1e9);
const ll mod = (ll)(1e9) + 7;
const double eps = 1e-9;

ll n, x[N], y[N], ans;

unordered_map <ll, ll> X, Y;

int main () {
	ios_base :: sync_with_stdio (false); cin.tie(0);
//	freopen(fname".in", "r", stdin);
	//freopen(fname".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) {
		ans += (X[x[i]] - 1) * (Y[y[i]] - 1);
	}
	cout << ans;
	return 0;
}

Compilation message

triangle.cpp:23:1: error: ‘unordered_map’ does not name a type
 unordered_map <ll, ll> X, Y;
 ^
triangle.cpp: In function ‘int main()’:
triangle.cpp:32:3: error: ‘X’ was not declared in this scope
   X[x[i]]++;
   ^
triangle.cpp:33:3: error: ‘Y’ was not declared in this scope
   Y[y[i]]++;
   ^
triangle.cpp:36:11: error: ‘X’ was not declared in this scope
   ans += (X[x[i]] - 1) * (Y[y[i]] - 1);
           ^
triangle.cpp:36:27: error: ‘Y’ was not declared in this scope
   ans += (X[x[i]] - 1) * (Y[y[i]] - 1);
                           ^