제출 #1224859

#제출 시각아이디문제언어결과실행 시간메모리
1224859im2xtremeArranging Shoes (IOI19_shoes)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int64; int64 count_swaps(int S[], int n) { vector<bool> used(n, false); int64 swaps = 0; for (int i = 0; i < n; i++) { if (used[i]) continue; if (S[i] < 0)

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

shoes.cpp: In function 'int64 count_swaps(int*, int)':
shoes.cpp:13:22: error: expected statement at end of input
   13 |         if (S[i] < 0)
      |                      ^
shoes.cpp:13:22: error: expected '}' at end of input
shoes.cpp:10:33: note: to match this '{'
   10 |     for (int i = 0; i < n; i++) {
      |                                 ^
shoes.cpp:13:22: error: expected '}' at end of input
   13 |         if (S[i] < 0)
      |                      ^
shoes.cpp:6:35: note: to match this '{'
    6 | int64 count_swaps(int S[], int n) {
      |                                   ^
shoes.cpp:13:22: warning: no return statement in function returning non-void [-Wreturn-type]
   13 |         if (S[i] < 0)
      |                      ^