제출 #467527

#제출 시각아이디문제언어결과실행 시간메모리
467527lordlorinc동굴 (IOI13_cave)C++17
0 / 100
75 ms368 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; // int main(){ // return 0; // } void exploreCave(int n) { int swiches[n], partners[n]; bool founded[n]; fill(founded, founded + n, false); fill(partners, partners + n, -1); for (int i = 0; i < n; i++) { cin >> swiches[i]; } for (int i = 0; i < n; i++) { int l = 0, r = n - 1; for (int j = 0; j < n; j++) { if (founded[j] == false) { swiches[j] = 0; } } int status = tryCombination(swiches) < i; while (l != r){ int mid = (l + r) / 2; for (int j = l; j <= r; j++) { if (founded[j] == true) continue; if (j <= mid){ swiches[j] = status; } else{ swiches[j] = 1 - status; } } if (tryCombination(swiches) < i){ l = mid + 1; } else r = mid; } founded[l] = true; partners[i] = l; } answer(swiches, partners); }
#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...