Submission #142547

# Submission time Handle Problem Language Result Execution time Memory
142547 2019-08-09T14:01:26 Z vardan__02 Star triangles (IZhO11_triangle) C++14
Compilation error
0 ms 0 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;
map<ll,ll> x,y;
ll i, j, n, m, k, p, q, a[300005], b[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;
}

Compilation message

triangle.cpp:13:1: error: 'map' does not name a type
 map<ll,ll> x,y;
 ^~~
triangle.cpp: In function 'int main()':
triangle.cpp:24:3: error: 'x' was not declared in this scope
   x[a[i]]++;
   ^
triangle.cpp:25:3: error: 'y' was not declared in this scope
   y[b[i]]++;
   ^
triangle.cpp:28:9: error: 'x' was not declared in this scope
   m += (x[a[i]] - 1)*(y[b[i]] - 1);
         ^
triangle.cpp:28:23: error: 'y' was not declared in this scope
   m += (x[a[i]] - 1)*(y[b[i]] - 1);
                       ^