Submission #403878

#TimeUsernameProblemLanguageResultExecution timeMemory
403878IwanttobreakfreeGondola (IOI14_gondola)C++98
Compilation error
0 ms0 KiB
#include "gondola.h" #include <vector> #include <set> using namespace std; int valid(int n, int inputSeq[]){ int mini=1e9,pos,cont=0; for(int i=0;i<n;i++){ if(inputSeq[i]<mini){ mini=inputSeq[i]; pos=i; } } vector<int>v(n); for(int i=pos;i<n;i++){ v[cont]=inputSeq[i]; cont++; } for(int i=0;i<pos;i++){ v[cont]=inputSeq[i]; cont++; } for(int i=0;i<n;i++){ if(v[i]>n){ if(s.find(v[i]==s.end())){ s.insert(v[i]); } else return 0; } if(v[i]-mini!=i)return 0; } return 1; } int replacement(int n, int gondolaSeq[], int replacementSeq[]){ /*int mini=1e9,pos,cont=0; for(int i=0;i<n;i++){ if(inputSeq[i]<mini){ mini=inputSeq[i]; pos=i; } } vector<int>v(n); for(int i=pos;i<n;i++){ v[cont]=inputSeq[i]; cont++; } for(int i=0;i<pos;i++){ v[cont]=inputSeq[i]; cont++; }*/ return 0; } int countReplacement(int n, int inputSeq[]){ return -3; }

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:24:8: error: 's' was not declared in this scope
   24 |     if(s.find(v[i]==s.end())){
      |        ^