Submission #352428

#TimeUsernameProblemLanguageResultExecution timeMemory
352428David_MCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" int c[5003],f[5003],a[5003],i,j,x,l,r,m; void A(int r){for(;r>=l;r--)c[r]^=!f[r];} int T()return tryCombination(c)+8192&8191; void exploreCave(int N){ for(;i<N;i++){ l=0,r=N-1; if(T(c)>i)A(r); while(l<=r){ m=l+r>>1; A(m); T(c)>i?a[i]=m,A(m),r=m-1:A(m),l=m+1; } f[a[i]]=1; } answer(c,a); }

Compilation message (stderr)

cave.cpp: In function 'int T()':
cave.cpp:4:8: error: named return values are no longer supported
    4 | int T()return tryCombination(c)+8192&8191;
      |        ^~~~~~
cave.cpp:6:12: error: 'N' was not declared in this scope
    6 |     for(;i<N;i++){
      |            ^
cave.cpp:8:12: error: too many arguments to function 'int T()'
    8 |      if(T(c)>i)A(r);
      |            ^
cave.cpp:4:5: note: declared here
    4 | int T()return tryCombination(c)+8192&8191;
      |     ^
cave.cpp:10:10: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   10 |       m=l+r>>1;
      |         ~^~
cave.cpp:12:10: error: too many arguments to function 'int T()'
   12 |       T(c)>i?a[i]=m,A(m),r=m-1:A(m),l=m+1;
      |          ^
cave.cpp:4:5: note: declared here
    4 | int T()return tryCombination(c)+8192&8191;
      |     ^
cave.cpp:12:25: error: third operand to the conditional operator is of type 'void', but the second operand is neither a throw-expression nor of type 'void'
   12 |       T(c)>i?a[i]=m,A(m),r=m-1:A(m),l=m+1;
      |              ~~~~~~~~~~~^~~~~~
cave.cpp:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^