제출 #154355

#제출 시각아이디문제언어결과실행 시간메모리
154355arnold518동굴 (IOI13_cave)C++14
100 / 100
1167 ms596 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 5000; int N, S[MAXN+10], D[MAXN+10], T[MAXN+10], E[MAXN+10], F[MAXN+10]; void exploreCave(int _N) { int i, j; N=_N; for(i=0; i<N; i++) { memset(T, 0, sizeof(T)); for(j=0; j<i; j++) T[D[j]]=S[j]; int t=tryCombination(T); if(t==-1 || t>i) S[i]=0; else S[i]=1; int lo=0, hi=N; while(lo+1<hi) { int mid=lo+hi>>1; for(j=0; j<N; j++) { if(j<mid) T[j]=!S[i]; else T[j]=S[i]; } for(j=0; j<i; j++) T[D[j]]=S[j]; t=tryCombination(T); if(t==-1 || t>i) lo=mid; else hi=mid; } D[i]=lo; } for(i=0; i<N; i++) E[D[i]]=i; for(i=0; i<N; i++) F[D[i]]=S[i]; answer(F, E); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:31:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
             int mid=lo+hi>>1;
                     ~~^~~
#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...