제출 #839598

#제출 시각아이디문제언어결과실행 시간메모리
839598sleepntsheepCombo (IOI18_combo)C++17
0 / 100
0 ms208 KiB
#include "combo.h" #include <string> #include <vector> using namespace std; #define BUT "ABXY" string guess_sequence(int N) { string ans(2005, 0); int j = 0; vector<int> non(2005, 0); for (int i = 0; i < 4; ++i) { ans[0] = BUT[i]; ans[1] = 'A'; int k = press(ans); if (k >= 1) ++j, non[1] |= 1; if (k == 2) ++j; } for (int i = j; i < N;) { int nxt = i + 1; for (int j = 0; j < 4; j++) { if (non[i] & (1 << j)) continue; ans[i] = BUT[j]; ans[i+1] = i + 1 < N ? 'A' : 0; int k = press(ans); if (k >= i + 1) { non[i+1] |= 1; } if (k == i + 2) { nxt = i + 2; } if (k >= i + 1) goto FND; } FND:; i = nxt; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...