제출 #17242

#제출 시각아이디문제언어결과실행 시간메모리
17242erdemkiraz곤돌라 (IOI14_gondola)C++98
컴파일 에러
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; }

컴파일 시 표준 에러 (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]
 }
 ^