Submission #962657

#TimeUsernameProblemLanguageResultExecution timeMemory
962657simona1230Cave (IOI13_cave)C++17
0 / 100
94 ms520 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; int n; int c[5000],d[5000]; int p[5000],l[5000]; int used[5000]; void exploreCave(int N) { n=N; int x=tryCombination(l); for(int i=0;i<n;i++) { for(int j=0;j<n;j++) p[j]=c[j]; int l=1,r=n-i; while(l!=r) { int m=(l+r)/2; int cnt=0; for(int j=0;j<n;j++) { if(!used[j]) { cnt++; p[j]=1; } } int y=tryCombination(p); if(x==i&&x!=y||x>i&&x==y) { r=m; } else { l=m+1; } } d[i]=l; c[i]=p[i]; x=tryCombination(c); } for(int i=0;i<n;i++) c[i]=1^c[i]; answer(c,d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:34:20: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   34 |             if(x==i&&x!=y||x>i&&x==y)
      |                ~~~~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...