Submission #1100598

#TimeUsernameProblemLanguageResultExecution timeMemory
1100598vjudge1별들과 삼각형 (IZhO11_triangle)C++98
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
signed main()
{
    int n;
    cin >> n;
    int x[100000, y[100000];
    map<int, int> mp1, mp2;
    for(int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i];
        mp1[x[i]]++;
        mp2[y[i]]++;
    }
    int k = 0;
    for(int i = 0; i < n; i++)
    {
        k += (mp1[x[i]] - 1) * (mp2[y[i]] - 1);
    }
    cout << k;
}

Compilation message (stderr)

triangle.cpp: In function 'int main()':
triangle.cpp:7:17: error: expected ']' before ',' token
    7 |     int x[100000, y[100000];
      |                 ^
      |                 ]
triangle.cpp:11:16: error: 'x' was not declared in this scope
   11 |         cin >> x[i] >> y[i];
      |                ^
triangle.cpp:18:19: error: 'x' was not declared in this scope
   18 |         k += (mp1[x[i]] - 1) * (mp2[y[i]] - 1);
      |                   ^