Submission #713041

#TimeUsernameProblemLanguageResultExecution timeMemory
713041lamCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; int n; int dau[],s[],d[]; vector <int> tmp; void exploreCave(int N) { /* ... */ n=N; for (int i=0; i<n; i++) dau[i]=0; for (int it=0; it<n; it++) { int temp = tryCombination(dau); if (temp > it || temp==-1) { for (int i:tmp) dau[i] ^= 1; temp = tryCombination(dau); } int l = 0; int r=tmp.size()-1; while (l<r) { int mid=(l+r)/2; for (int i=0; i<=mid; i++) dau[tmp[i]]^=1; int val = tryCombination(dau); for (int i=0; i<=mid; i++) dau[tmp[i]]^=1; if (val>it||val==-1) r=mid; else l=mid+1; } d[it] = tmp[r]; dau[d[it]] ^= 1; for (int i=r+1; i<tmp.size(); i++) swap(tmp[i],tmp[i-1]); tmp.pop_back(); } answer(dau,d); }

Compilation message (stderr)

cave.cpp:5:5: error: storage size of 'dau' isn't known
    5 | int dau[],s[],d[];
      |     ^~~
cave.cpp:5:11: error: storage size of 's' isn't known
    5 | int dau[],s[],d[];
      |           ^
cave.cpp:5:15: error: storage size of 'd' isn't known
    5 | int dau[],s[],d[];
      |               ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:31:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |         for (int i=r+1; i<tmp.size(); i++) swap(tmp[i],tmp[i-1]);
      |                         ~^~~~~~~~~~~