제출 #298019

#제출 시각아이디문제언어결과실행 시간메모리
298019miss_robot콤보 (IOI18_combo)C++14
100 / 100
39 ms596 KiB
#include <bits/stdc++.h> #include "combo.h" #pragma GCC optimize("O3") using namespace std; string guess_sequence(int N){ string p, t, test; int ans; if(press("AB")){ if(press("A")) p = "A", t = "BXY"; else p = "B", t = "AXY"; } else{ if(press("X")) p = "X", t = "ABY"; else p = "Y", t = "ABX"; } if(N == 1) return p; for(int i = 1; i < N-1; i++){ test = p; test += t[0]; test += p; test += t[1]; test += t[0]; test += p; test += t[1]; test += t[1]; test += p; test += t[1]; test += t[2]; ans = press(test)-i; if(ans == 2) p += t[1]; else if(ans) p += t[0]; else p += t[2]; } p += t[0]; if(press(p) != N){ p.pop_back(); p += t[1]; if(press(p) != N) p.pop_back(), p += t[2]; } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...