제출 #208324

#제출 시각아이디문제언어결과실행 시간메모리
208324alexxela12345Arranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
long long count_swaps(vector<int> a) {
  int n = a.size() / 2;
  long long ans = 0;
  while (n) {
    int x = a[0];
    int ind = 1;
    while (a[ind] != -x) {
      ind++;
    }
    if (x < 0) {
      ans += ind - 1;
    } else {
      ans += ind;
    }
    a.erase(a.begin() + ind);
    a.erase(a.begin());
    n--;
  }
  return ans;
}

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

shoes.cpp:1:23: error: 'vector' was not declared in this scope
 long long count_swaps(vector<int> a) {
                       ^~~~~~
shoes.cpp:1:30: error: expected primary-expression before 'int'
 long long count_swaps(vector<int> a) {
                              ^~~