제출 #992966

#제출 시각아이디문제언어결과실행 시간메모리
992966lacito동굴 (IOI13_cave)C++14
0 / 100
46 ms344 KiB
#include"cave.h" #include <bits/stdc++.h> #define ll long long #define endl '\n' //#define f first //#define s second using namespace std; void exploreCave(int n) { int s[n],d[n]; for (int i=0; n>i; i++) { s[i] = 0; d[i] = -1; } for (int i=0; n>i; i++) { if (tryCombination(s) != i) { for (int j=0; n>j; j++) { if (d[j] != -1) continue; s[j] ^= 1; } } int l = 0 , r = n - 1; int mid = (l + r) / 2; int f = s[i]; while (l < r) { mid = (l + r) / 2; for (int j=l; mid>=j; j++) { if (d[j] != -1) continue; s[j] ^= 1; } int l1=l; if (tryCombination(s) != i) { r = mid; f ^= 1; } else { l = mid + 1; } for (int j=l1; mid>=j; j++) { if (d[j] != -1) continue; s[j] ^= 1; } } s[i] = f; d[l] = i; } answer(s , d); }
#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...