제출 #421426

#제출 시각아이디문제언어결과실행 시간메모리
421426alireza_kaviani콤보 (IOI18_combo)C++11
5 / 100
1 ms200 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; vector<string> vec = {"A" , "B" , "X" , "Y"} , valid; string guess_sequence(int n){ string cur = ""; for(int i = 0 ; i < 3 ; i++){ if(press(vec[i]) == 1){ cur = vec[i]; break; } } if(cur.size() == 0) cur = vec[3]; for(string i : vec){ if(i != cur){ valid.push_back(i); } } for(int i = 1 ; i + 1 < n ; i++){ string ask = cur + valid[1]; for(string j : valid) ask += cur + valid[2] + j; int res = press(ask); for(int j = 0 ; j < 3 ; j++){ if(res == i + j) cur += valid[j]; } } for(int i = 0 ; i < 2 ; i++){ if(press(cur + valid[i]) == n) return cur + valid[i]; } return cur + valid[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...