Submission #1224859

#TimeUsernameProblemLanguageResultExecution timeMemory
1224859im2xtremeArranging Shoes (IOI19_shoes)C++20
Compilation error
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)

Compilation message (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)
      |                      ^