제출 #303880

#제출 시각아이디문제언어결과실행 시간메모리
303880rocks03동굴 (IOI13_cave)C++14
34 / 100
67 ms512 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; void answer(int S[], int D[]); int tryCombination(int S[]); void exploreCave(int N){ int ans[N], d[N]; memset(ans, 0, sizeof(ans)); memset(d, -1, sizeof(d)); vector<int> vis(N, false); int res = tryCombination(ans); do{ if(res == -1){ for(int i = 0; i < N; i++){ if(d[i] == -1){ ans[i] ^= 1; res = tryCombination(ans); break; } } } for(int j = 0; j < N; j++){ if(d[j] != -1){ continue; } ans[j] ^= 1; int res2 = tryCombination(ans); if(res2 == -1 || res2 > res){ d[j] = res; res = res2; break; } else{ ans[j] ^= 1; continue; } } if(res == -1){ for(int i = 0; i < N; i++){ if(d[i] == -1){ ans[i] ^= 1; res = tryCombination(ans); break; } } } } while(res != -1); for(int i = 0; i < N; i++){ if(d[i] == -1){ ans[i] ^= 1; d[i] = tryCombination(ans); ans[i] ^= 1; } } answer(ans, 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...