제출 #350074

#제출 시각아이디문제언어결과실행 시간메모리
350074tjrwodnjs999동굴 (IOI13_cave)C++11
0 / 100
236 ms620 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; void exploreCave(int N) { int arr[N],pos[N],qry[N]; fill(arr,arr+N,-1); for(int i=0;i<N;i++){ vector<int> vt; for(int j=0;j<N;j++){ if(arr[j]==-1) vt.push_back(j); else qry[j]=pos[j]; } int cur; for(int j:vt) qry[j]=0; int tr=tryCombination(qry); if(tr>=i) cur=0; else cur=1; for(int j:vt) qry[j]=1-cur; int l=0,r=vt.size()-1; while(l<=r){ if(l==r) {arr[l]=i,pos[l]=cur;break;} int mid=l+r>>1; for(int i=l;i<=mid;i++) qry[vt[i]]=cur; int ans=tryCombination(qry); for(int i=l;i<=mid;i++) qry[vt[i]]=1-cur; if(ans>=i) r=mid; else l=mid+1; } } answer(pos,arr); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:23:22: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   23 |             int mid=l+r>>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...