Submission #17242

#TimeUsernameProblemLanguageResultExecution timeMemory
17242erdemkirazGondola (IOI14_gondola)C++98
Compilation error
0 ms0 KiB
#include "gondola.h" int valid(int n, int inputSeq[]) { int ind = -1, x = -1; for(int i = 0; i < n; i++) { if(inputSeq[i] <= n) { ind = i; x = inputSeq[i]; break; } } if(ind == -1) return 1; for(int i = ind + 1; i < n; i++) { if(inputSeq[i] <= n and (x + i - ind - 1) % n + 1 != inputSeq[i]) return 0; } set < int > s; for(int i = 0; i < n; i++) s.insert(inputSeq[i]); return s.size() == n; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }

Compilation message (stderr)

gondola.cpp: In function ‘int valid(int, int*)’:
gondola.cpp:18:2: error: ‘set’ was not declared in this scope
  set < int > s;
  ^
gondola.cpp:18:8: error: expected primary-expression before ‘int’
  set < int > s;
        ^
gondola.cpp:20:3: error: ‘s’ was not declared in this scope
   s.insert(inputSeq[i]);
   ^
gondola.cpp:21:9: error: ‘s’ was not declared in this scope
  return s.size() == n;
         ^
gondola.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^