제출 #305581

#제출 시각아이디문제언어결과실행 시간메모리
305581amunduzbaev콤보 (IOI18_combo)C++14
100 / 100
41 ms568 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string s="ABXY"; int fun(string p,int i) { int len=press(p+s[0]+p+s[1]); int id=2*(len<i); len=press(p+s[id]); id+=(len<i); return id; } string guess_sequence(int n) { string p = ""; { int id=fun(p,1); p+=s[id]; if(id!=3) swap(s[id],s[3]); } for(int i=2;i<n;i++){ string z=""; for(int j=0;j<3;j++) { z+=p+s[0]+s[j]; } z+=p+s[1]; int len=press(z); if(len==i+1){ p+=s[0]; } else if(len==i){ p+=s[1]; } else{ p+=s[2]; } } if(n>1) { int id=fun(p,n); p+=s[id]; } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...