제출 #532928

#제출 시각아이디문제언어결과실행 시간메모리
532928devariaota별들과 삼각형 (IZhO11_triangle)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;

  map<int, int> mpx;
  map<int, int> mpy;

  pair<int, int> coor[n+5];

  for(int i = 1; i<=n; i++) {
    int a, b;
    cin >> a >> b;
    coor[i] = {a, b};
    mpx[a]++;
    mpy[b]++;
  }

  long long total1 = 0;

  for(int i = 1; i<=n; i++) {
    total1 += 1ll*mpx[coor[i].first]-1)*(mpy[coor[i].second]-1);
  }

  cout << total1 << endl;

  
}

컴파일 시 표준 에러 (stderr) 메시지

triangle.cpp: In function 'int main()':
triangle.cpp:24:39: error: expected ';' before ')' token
   24 |     total1 += 1ll*mpx[coor[i].first]-1)*(mpy[coor[i].second]-1);
      |                                       ^
      |                                       ;