제출 #464730

#제출 시각아이디문제언어결과실행 시간메모리
464730AdamGS동굴 (IOI13_cave)C++14
0 / 100
190 ms408 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(a, b) for(int a = 0; a < (b); ++a) #define st first #define nd second #define pb push_back #define all(a) a.begin(), a.end() const int LIM=1e3+7; void exploreCave(int N) { int S[N], D[N]; rep(i, N) { S[i]=0; D[i]=-1; } int lst=tryCombination(S); rep(i, N) { int p=0, k=N-1; while(p<k) { int sr=(p+k)/2; for(int j=p; j<=sr; ++j) if(D[j]==-1) S[j]^=1; int nowe=tryCombination(S); if(nowe>i && lst>i || nowe==i && lst==i) p=sr+1; else k=sr; lst=nowe; } D[i]=p; if(lst==i) S[i]^=1; } answer(S, D); }

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:25:14: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   25 |    if(nowe>i && lst>i || nowe==i && lst==i) p=sr+1; else k=sr;
      |       ~~~~~~~^~~~~~~~
#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...