제출 #585699

#제출 시각아이디문제언어결과실행 시간메모리
585699alireza_kaviani콤보 (IOI18_combo)C++17
100 / 100
37 ms584 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string s , t = "ABXY"; string guess_sequence(int N) { int ind = (press("XY") > 0) * 2 + (press("BY") > 0); s += t[ind]; t = t.substr(0 , ind) + t.substr(ind + 1 , 10); if(N == 1){ return s; } for(int i = 1 ; i + 1 < N ; i++){ string query = s + t[0] + t[0] + s + t[0] + t[1] + s + t[0] + t[2] + s + t[1]; int ind = i + 2 - press(query); s += t[ind]; } int last = 0; for(int i = 1 ; i < 3 ; i++){ if(press(s + t[i]) == N){ last = i; } } s += t[last]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...