제출 #231122

#제출 시각아이디문제언어결과실행 시간메모리
231122peijarArranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define SZ(v) ((int)(v).size()) using ll = long long; ll count_swaps(vector<int> shoes) { int nb_chaussures = SZ(shoes); ll nb_swaps(0); for (int i(1); i < nb_chaussures; ++i) { for (int j(0); j < i; ++j) if (shoes[i] + shoes[j] == 0) { int cur = i; while (cur > j+1) { swap(shoes[cur], shoes[cur-1]); --cur; ++nb_swaps; } if (shoes[j] > 0) { ++nb_swaps; swap(shoes[j], shoes[j+1]); } shoes[j] = shoes[j+1] = 0; break; } } return nb_swaps;

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

shoes.cpp: In function 'll count_swaps(std::vector<int>)':
shoes.cpp:33:17: error: expected '}' at end of input
  return nb_swaps;
                 ^