Submission #1217859

#TimeUsernameProblemLanguageResultExecution timeMemory
1217859lukasuliashviliCave (IOI13_cave)C++20
Compilation error
0 ms0 KiB
#include"cave.h". #include<bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define fs first #define sc second #define rep(i,a,b) for(int i=a; i<b; i++) const int N1=2*1e6+5; int fix[N1],ans[N1]; signed main(){ int N; cin>>N; rep(i,0,N){fix[i]=-1;ans[i]=-1;} // ans[j] --> j chamrtvelistvis romeli karia // fix[i] i karistvis 1 ia tu -1 for(int i=0; i<N; i++){ rep(j,0,N){ if(ans[j]!=-1){ s[j]=fix[ans[j]]<<" "; } else{ s[j]=0; } } int last=tryCombination(s); if( last<=i and last!=-1){ fix[i]=1; } else{ fix[i]=0; } int l=0; int r=N-1; while(l<=r){ if(l==r){ ans[l]=i; break; } int mid=(l+r)/2; rep(j,0,l){ if(ans[j]!=-1){ s[j]=fix[ans[j]]; } else{ s[j]=(fix[i]^1); } } rep(j,l,mid+1){ if(ans[j]!=-1){ s[j]=fix[ans[j]]; } else{ s[j]=fix[i]; } } rep(j,mid+1,N){ if(ans[j]!=-1){ s[j]=fix[ans[j]]; } else{ s[j]=(fix[i]^1); } } tryCombination() cin>>last; if(last<=i and last!=-1){ l=mid+1; } else{ r=mid; } } } rep(i,0,N){ ans2[i]=fix[ans[i]]; } answer(ans2,ans); // ans2 ans }

Compilation message (stderr)

cave.cpp:1:17: warning: extra tokens at end of #include directive
    1 | #include"cave.h".
      |                 ^
cave.cpp: In function 'int main()':
cave.cpp:20:33: error: 's' was not declared in this scope
   20 |                                 s[j]=fix[ans[j]]<<" ";
      |                                 ^
cave.cpp:20:49: error: invalid operands of types 'long long int' and 'const char [2]' to binary 'operator<<'
   20 |                                 s[j]=fix[ans[j]]<<" ";
      |                                      ~~~~~~~~~~~^~~~~
      |                                                |  |
      |                                                |  const char [2]
      |                                                long long int
cave.cpp:23:33: error: 's' was not declared in this scope
   23 |                                 s[j]=0;
      |                                 ^
cave.cpp:27:41: error: 's' was not declared in this scope
   27 |                 int last=tryCombination(s);
      |                                         ^
cave.cpp:66:39: error: too few arguments to function 'int tryCombination(int*)'
   66 |                         tryCombination()
      |                         ~~~~~~~~~~~~~~^~
In file included from cave.cpp:1:
cave.h:8:5: note: declared here
    8 | int tryCombination(int S[]);
      |     ^~~~~~~~~~~~~~
cave.cpp:78:17: error: 'ans2' was not declared in this scope; did you mean 'ans'?
   78 |                 ans2[i]=fix[ans[i]];
      |                 ^~~~
      |                 ans
cave.cpp:80:16: error: 'ans2' was not declared in this scope; did you mean 'ans'?
   80 |         answer(ans2,ans);
      |                ^~~~
      |                ans