Submission #230320

#TimeUsernameProblemLanguageResultExecution timeMemory
230320pere_gilGondola (IOI14_gondola)C++14
Compilation error
0 ms0 KiB
int replacement(int n, int gondolaSeq, int replacementSeq){ return -3; } int countReplacement(int n, int inputSeq){ return -3; } int valid(int n, int inputSeq){ int res=1; for(int i=1;i<n;i++){ if(inputSeq[i]!=inputSeq[i-1]+1 && inputSeq[i-1]!=1 && inputSeq[i]!=1){ res=0; } } if(inputSeq[0]!=1 && inputSeq[0]-1!=inputSeq[n-1]){ res=0; } return res; }

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int)':
gondola.cpp:12:22: error: invalid types 'int[int]' for array subscript
         if(inputSeq[i]!=inputSeq[i-1]+1 && inputSeq[i-1]!=1 && inputSeq[i]!=1){
                      ^
gondola.cpp:12:37: error: invalid types 'int[int]' for array subscript
         if(inputSeq[i]!=inputSeq[i-1]+1 && inputSeq[i-1]!=1 && inputSeq[i]!=1){
                                     ^
gondola.cpp:12:56: error: invalid types 'int[int]' for array subscript
         if(inputSeq[i]!=inputSeq[i-1]+1 && inputSeq[i-1]!=1 && inputSeq[i]!=1){
                                                        ^
gondola.cpp:12:74: error: invalid types 'int[int]' for array subscript
         if(inputSeq[i]!=inputSeq[i-1]+1 && inputSeq[i-1]!=1 && inputSeq[i]!=1){
                                                                          ^
gondola.cpp:16:18: error: invalid types 'int[int]' for array subscript
     if(inputSeq[0]!=1 && inputSeq[0]-1!=inputSeq[n-1]){
                  ^
gondola.cpp:16:36: error: invalid types 'int[int]' for array subscript
     if(inputSeq[0]!=1 && inputSeq[0]-1!=inputSeq[n-1]){
                                    ^
gondola.cpp:16:53: error: invalid types 'int[int]' for array subscript
     if(inputSeq[0]!=1 && inputSeq[0]-1!=inputSeq[n-1]){
                                                     ^