제출 #133467

#제출 시각아이디문제언어결과실행 시간메모리
133467KieranHorgan콤보 (IOI18_combo)C++17
0 / 100
1 ms200 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string p = "AB"; int x = press(p); vector<char> v; string S; if(x==2) { S="A"; v={'B','X','Y'}; } else if(x==1) { S="B"; v={'A','X','Y'}; } else { if(press("X")) { S="X"; v = {'A','B','Y'}; } else { S="Y"; v = {'A','B','X'}; } } for(int i = 1; i < N-1; i++) { string t; t += S; t.push_back(v[0]); t += S; t.push_back(v[1]); t.push_back(v[0]); t += S; t.push_back(v[1]); t.push_back(v[1]); t += S; t.push_back(v[1]); t.push_back(v[2]); int x = press(t); if(x==i) { S.push_back(v[2]); } else if(x==i+1) { S.push_back(v[0]); } else { S.push_back(v[1]); } } string t; t = S; t.push_back(v[0]); if(press(t) == N) return t; t = S; t.push_back(v[1]); if(press(t) == N) return t; t = S; t.push_back(v[2]); // if(press(t) == N) return t; return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...