제출 #464746

#제출 시각아이디문제언어결과실행 시간메모리
464746AdamGS동굴 (IOI13_cave)C++14
100 / 100
261 ms456 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; #define rep(a, b) for(int a = 0; a < (b); ++a) 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[p]=i; if(lst==i) S[p]^=1; lst=tryCombination(S); } answer(S, D); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:18:15: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   18 |    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...