Submission #672604

#TimeUsernameProblemLanguageResultExecution timeMemory
672604paulo_arCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" int s [5004]; int res [5004]; bool activos [5004]; vector ans; int busqueda (bool esuno, int inde, int n){ int izq=1, int der=n; int mitad; int master; while(izq<=der){ mitad=(izq+der)/2; if(esuno)master=0; else master=1; for(int i=1; i<=mitad; i++){ if(res[i]){ s[i]=res[i]; } else{ s[i]=master; } } if(esuno)master=1; else master=0; for(int i=mitad+1; i<=n; i++){ if(res[i]){ s[i]=res[i]; } else{ s[i]=master; } } if(tryCombination(s[])>=inde){ der=mitad-1; } else { izq=mitad+1; } } return mitad; } void exploreCave(int N) { string s = ""; int ll; for(int i=1; i<=n; i++){ res[i]=false; } for(int j=1; j<=n; j++){ for(int i=1; i<=n; i++){ if(res[i]){ s[i]=res[i]; } else{ s[i]=master; } } ll=tryCombination(s[]); int des; int a; if(ll>=i){ des= busqueda(true,i,N): a=1; } else { des=busqueda(false,i,N); a=0; } activos [des]=true; res[der]=a; ans.push_back(des); } answer(s[], ans[]); // int tryCombination(int S[]); //void answer(int S[], int D[]); //void exploreCave(int N); }

Compilation message (stderr)

cave.cpp:7:1: error: 'vector' does not name a type
    7 | vector ans;
      | ^~~~~~
cave.cpp: In function 'int busqueda(bool, int, int)':
cave.cpp:10:16: error: expected unqualified-id before 'int'
   10 |     int izq=1, int der=n;
      |                ^~~
cave.cpp:13:16: error: 'der' was not declared in this scope
   13 |     while(izq<=der){
      |                ^~~
cave.cpp:38:30: error: expected primary-expression before ']' token
   38 |          if(tryCombination(s[])>=inde){
      |                              ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:50:4: error: 'string' was not declared in this scope
   50 |    string s = "";
      |    ^~~~~~
cave.cpp:52:21: error: 'n' was not declared in this scope
   52 |     for(int i=1; i<=n; i++){
      |                     ^
cave.cpp:56:20: error: 'n' was not declared in this scope
   56 |    for(int j=1; j<=n; j++){
      |                    ^
cave.cpp:63:18: error: 'master' was not declared in this scope
   63 |             s[i]=master;
      |                  ^~~~~~
cave.cpp:66:24: error: expected primary-expression before ']' token
   66 |    ll=tryCombination(s[]);
      |                        ^
cave.cpp:69:11: error: 'i' was not declared in this scope
   69 |    if(ll>=i){
      |           ^
cave.cpp:79:8: error: 'der' was not declared in this scope; did you mean 'des'?
   79 |    res[der]=a;
      |        ^~~
      |        des
cave.cpp:80:4: error: 'ans' was not declared in this scope
   80 |    ans.push_back(des);
      |    ^~~
cave.cpp:84:14: error: expected primary-expression before ']' token
   84 |     answer(s[], ans[]);
      |              ^
cave.cpp:84:17: error: 'ans' was not declared in this scope
   84 |     answer(s[], ans[]);
      |                 ^~~
cave.cpp:84:21: error: expected primary-expression before ']' token
   84 |     answer(s[], ans[]);
      |                     ^