Submission #120005

#TimeUsernameProblemLanguageResultExecution timeMemory
120005nxteruCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; #define PB push_back int n,ans[5005],k,s[5005]; void exploreCave(int N) { n=N; while(1){ vector<int>x; for(int i=0;i<n;i++)if(ans[i]==-1)x.PB(i); if(x.size()==0)break; int p=tryCombination(s); if(p==-1||p>k)p=1; else p=0; while(x.size()>1){ for(int i=0;i<x.size()/2;i++)s[x[i]]^=1; int q=tryCombination(s); if(q==-1||q>k)q=1; else q=0; vector<int>y; if(p==q)for(int i=x.size()/2;i<x.size();i++)y.PB(x[i]); else for(int i=0;i<x.size()/2;i++)y.PB(x[i]); x.clear(); for(int i=0;i<y.size();i++)x.PB(y[i]); p=q; } ans[x[i]]=k++; if(p==0)s[x[i]]^=1; } answer(s,ans); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:16:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int i=0;i<x.size()/2;i++)s[x[i]]^=1;
                ~^~~~~~~~~~~
cave.cpp:21:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if(p==q)for(int i=x.size()/2;i<x.size();i++)y.PB(x[i]);
                                 ~^~~~~~~~~
cave.cpp:22:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    else for(int i=0;i<x.size()/2;i++)y.PB(x[i]);
                     ~^~~~~~~~~~~
cave.cpp:24:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int i=0;i<y.size();i++)x.PB(y[i]);
                ~^~~~~~~~~
cave.cpp:27:9: error: 'i' was not declared in this scope
   ans[x[i]]=k++;
         ^