제출 #290563

#제출 시각아이디문제언어결과실행 시간메모리
290563gabrc52콤보 (IOI18_combo)C++14
10 / 100
91 ms452 KiB
#include <iostream> #include <string> #define watch(x) cerr<<#x<<": "<<(x)<<endl #include "combo.h" using namespace std; char getFirst() { if (press("AB") >= 1) { return press("A")==1 ? 'A' : 'B'; } else { return press("X")==1 ? 'X' : 'Y'; } } string valid = "ABXY"; string guess_sequence(int N) { string p,S; char first = getFirst(); S.push_back(first); watch(first); for (int i=2; i<=N; i++) { for (char c : valid) { if (c != first) { if (press(S+c) == i) { S.push_back(c); break; } } } } watch(S); return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...