Submission #194168

#TimeUsernameProblemLanguageResultExecution timeMemory
194168juanmartinez111Gondola (IOI14_gondola)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "gondola.h" int valid(int n, int inputSeq[]) { vector<int>ans; int ini=0,fin=0; bool si=true; for(int i=0;i<n;i++){ if(inputSeq[i]==n)fin=i; if(inputSeq[i]==1)ini=i; int cnt=1; ans; while(ini!=fin){ ans.push_back(inputSeq[ini]); ini=(ini+1)%n; cnt++; } ans.push_back(inputSeq[fin]); for(int i=0;i<n;i++){ if(ans[i]!=i+1)si=false; } } return si; } //---------------------- 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:6:3: error: 'vector' was not declared in this scope
   vector<int>ans;
   ^~~~~~
gondola.cpp:6:3: note: suggested alternative:
In file included from /usr/include/c++/7/vector:64:0,
                 from /usr/include/c++/7/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86,
                 from gondola.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:216:11: note:   'std::vector'
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^~~~~~
gondola.cpp:6:10: error: expected primary-expression before 'int'
   vector<int>ans;
          ^~~
gondola.cpp:13:5: error: 'ans' was not declared in this scope
     ans;
     ^~~
gondola.cpp:13:5: note: suggested alternative: 'abs'
     ans;
     ^~~
     abs