답안 #531497

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
531497 2022-02-28T23:57:52 Z makanhulia 별들과 삼각형 (IZhO11_triangle) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

int main(){
  cin.tie(0) -> ios_base::sync_with_stdio(0);

  int n;
  cin >> n;
  vector<int> x(n), y(n);
  for(int i=0;i<n;i++)
  {
    cin >> x[i] >> y[i];
  }
  int ans = 0;
  for(int i=0;i<n;i++)
  {
    int cx = 0, cy = 0;
    for(int j=0;j<n;j++)
    {
      if(x[i] == x[j]) cx++;
      if(y[i] == y[j]) cy++;
    }
    ans += (cx - 1) * (cy - 1);
  }
  cout << ans << '
';
  
}

Compilation message

triangle.cpp:25:18: warning: missing terminating ' character
   25 |   cout << ans << '
      |                  ^
triangle.cpp:25:18: error: missing terminating ' character
triangle.cpp:26:1: warning: missing terminating ' character
   26 | ';
      | ^
triangle.cpp:26:1: error: missing terminating ' character
   26 | ';
      | ^~
triangle.cpp: In function 'int main()':
triangle.cpp:28:1: error: expected primary-expression before '}' token
   28 | }
      | ^