Submission #560144

#TimeUsernameProblemLanguageResultExecution timeMemory
560144StavabArranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; long long count_swaps(int[] S) { if(S[0] < 0) return 0; else return 1; } int main() { int n; cin >> n; int S[100000]; for(int i = 0; i < n; i++) { cin >> S[i]; } cout << count_swaps(S); return 0; }

Compilation message (stderr)

shoes.cpp:5:29: error: expected ',' or '...' before 'S'
    5 | long long count_swaps(int[] S)
      |                             ^
shoes.cpp: In function 'long long int count_swaps(int*)':
shoes.cpp:7:5: error: 'S' was not declared in this scope
    7 |  if(S[0] < 0) return 0;
      |     ^
shoes.cpp:9:1: warning: control reaches end of non-void function [-Wreturn-type]
    9 | }
      | ^