Submission #120003

#TimeUsernameProblemLanguageResultExecution timeMemory
120003nxteruCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int n,ans[5005],k,s[5005]; void exploreCave(int N) { n=N; for(int i=0;i<n;i++)ans[i]=-1,x.PB(i); 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 1=tryCombination(s); if(1==-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:7:35: error: 'x' was not declared in this scope
     for(int i=0;i<n;i++)ans[i]=-1,x.PB(i);
                                   ^
cave.cpp:10:39: error: 'class std::vector<int>' has no member named 'PB'
   for(int i=0;i<n;i++)if(ans[i]==-1)x.PB(i);
                                       ^~
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:17:8: error: expected unqualified-id before numeric constant
    int 1=tryCombination(s);
        ^
cave.cpp:18:14: error: 'q' was not declared in this scope
    if(1==-1||q>k)q=1;
              ^
cave.cpp:21:10: error: 'q' was not declared in this scope
    if(p==q)for(int i=x.size()/2;i<x.size();i++)y.PB(x[i]);
          ^
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:21:50: error: 'class std::vector<int>' has no member named 'PB'
    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:22:40: error: 'class std::vector<int>' has no member named 'PB'
    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:24:33: error: 'class std::vector<int>' has no member named 'PB'
    for(int i=0;i<y.size();i++)x.PB(y[i]);
                                 ^~
cave.cpp:25:6: error: 'q' was not declared in this scope
    p=q;
      ^
cave.cpp:27:9: error: 'i' was not declared in this scope
   ans[x[i]]=k++;
         ^