Submission #985073

#TimeUsernameProblemLanguageResultExecution timeMemory
985073user736482Cave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include<cave.h> using namespace std; int result[5000],match[5000],sent[5000]; bool iflastopen,fixed[5000]; void change(int a, int b){ for(int i=a;i<=b;i++){ if(!fixed[i]) sent[i]=!sent[i]; } } void exploreCave(int n){ for(int j=0;j<n;j++){ if(tryCombination(sent)>j) iflastopen=1; else iflastopen=0; int pocz=0; int kon=n-1; while(pocz!=kon){ int sr=(pocz+kon)/2; change(pocz,sr); int ak=tryCombination(sent); if((ak>j)==iflastopen){ pocz=sr+1; } else{ kon=sr-1; iflastopen=!iflastopen; } } if(iflastopen){ match[j]=pocz; fixed[pocz-1]=1; } else{ match[j]=pocz; fixed[pocz-1]=1; sent[pocz-1]=!sent[pocz-1]; } } answer(sent,match); }

Compilation message (stderr)

cave.cpp: In function 'void change(int, int)':
cave.cpp:8:13: error: reference to 'fixed' is ambiguous
    8 |         if(!fixed[i])
      |             ^~~~~
In file included from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from cave.cpp:1:
/usr/include/c++/10/bits/ios_base.h:1048:3: note: candidates are: 'std::ios_base& std::fixed(std::ios_base&)'
 1048 |   fixed(ios_base& __base)
      |   ^~~~~
cave.cpp:5:17: note:                 'bool fixed [5000]'
    5 | bool iflastopen,fixed[5000];
      |                 ^~~~~
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:35:13: error: reference to 'fixed' is ambiguous
   35 |             fixed[pocz-1]=1;
      |             ^~~~~
In file included from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from cave.cpp:1:
/usr/include/c++/10/bits/ios_base.h:1048:3: note: candidates are: 'std::ios_base& std::fixed(std::ios_base&)'
 1048 |   fixed(ios_base& __base)
      |   ^~~~~
cave.cpp:5:17: note:                 'bool fixed [5000]'
    5 | bool iflastopen,fixed[5000];
      |                 ^~~~~
cave.cpp:39:13: error: reference to 'fixed' is ambiguous
   39 |             fixed[pocz-1]=1;
      |             ^~~~~
In file included from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from cave.cpp:1:
/usr/include/c++/10/bits/ios_base.h:1048:3: note: candidates are: 'std::ios_base& std::fixed(std::ios_base&)'
 1048 |   fixed(ios_base& __base)
      |   ^~~~~
cave.cpp:5:17: note:                 'bool fixed [5000]'
    5 | bool iflastopen,fixed[5000];
      |                 ^~~~~