제출 #941973

#제출 시각아이디문제언어결과실행 시간메모리
9419734QT0R동굴 (IOI13_cave)C++17
0 / 100
303 ms348 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int n){ int cor[n]; fill(cor,cor+n,-1); int pos[n]; fill(pos,pos+n,-1); int S[n]; int kolor,odp,l,p,md,cur=0; for (int i = 0; i<n; i++){ for (int j = 0; j<n; j++){ if (cor[j]>=0)S[j]=cor[j]; else S[j]=0; } odp=tryCombination(S); if (odp==-1 || odp>i)kolor=0; else kolor=1; l=0,p=n-i; while(l<p){ md=(l+p)/2; cur=0; for (int j = 0; j<n; j++){ if (cor[j]>=0)S[j]=cor[j]; else if (cur++<md)S[j]=kolor; else S[j]=kolor^1; } odp=tryCombination(S); if (odp==-1 || odp>i)p=md; else l=md+1; } cor[l]=kolor; pos[l]=i; } answer(cor,pos); }
#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...