제출 #383105

#제출 시각아이디문제언어결과실행 시간메모리
383105Christopher_Rdz콤보 (IOI18_combo)C++17
100 / 100
53 ms652 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N){ string ini, s = ""; if (press("AB") != 0){ if (press("A") == 1){ ini = "A"; }else{ ini = "B"; } }else{ if (press("X") == 1){ ini = "X"; }else{ ini = "Y"; } } string l; if (ini == "A") l = "BXY"; if (ini == "B") l = "AXY"; if (ini == "X") l = "BAY"; if (ini == "Y") l = "BXA"; int p = 1; int ans; s += ini; for (int i = 2; i < N; i++){ ans = press(s + l[0] + l[0] + s + l[0] + l[1] + s + l[0] + l[2] + s + l[1]); if (ans == p){ s += l[2]; }else{ if (ans - p == 1){ s += l[1]; }else{ s += l[0]; } } p++; } if (N > 1){ if (press(s + l[0]) == N){ s += l[0]; }else{ if (press(s + l[1]) == N){ s += l[1]; }else{ s += l[2]; } } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...