제출 #75095

#제출 시각아이디문제언어결과실행 시간메모리
75095khsoo01콤보 (IOI18_combo)C++11
100 / 100
55 ms588 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; const char but[5] = "ABXY"; int cc; char ava[4]; string cur; void get1() { int T = 0; string X; X = cur + but[0] + cur + but[1]; if(press(X) == (int)cur.size()) T += 2; X = cur + but[T]; if(press(X) == (int)cur.size()) T += 1; cur += but[T]; } void get2() { string X = cur + ava[1] + cur + ava[2] + ava[0] + cur + ava[2] + ava[1] + cur + ava[2] + ava[2]; cur += ava[press(X) - (int)cur.size()]; } string guess_sequence(int N) { get1(); for(int i=0;i<4;i++) { if(but[i] != cur[0]) ava[cc++] = but[i]; } while((int)cur.size() < N) { if((int)cur.size() + 1 == N) get1(); else get2(); } return cur; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...