제출 #1029308

#제출 시각아이디문제언어결과실행 시간메모리
1029308XJP12콤보 (IOI18_combo)C++14
100 / 100
22 ms1924 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; // int press(string p){ // } string guess_sequence(int n){ string s; string temp; int x=press("AB"); string f; string combi; string other; string last; if(x>=1){ x = press("A"); if(x==1){ f="A"; combi="X"; other="B"; last="Y"; }else{ f="B"; combi="X"; other="A"; last="Y"; } }else{ x = press("X"); if(x==1){ f="X"; combi="A"; other="B"; last="Y"; }else{ f="Y"; combi="A"; other="B"; last="X"; } } s=f; while((int)s.size()!=n){ int size=(int)s.size(); if(size==n-1){ temp=s+combi+s+other; x=press(temp); if(x==size+1){ temp=s+combi; x=press(temp); if(x==size+1){ s+=combi; }else{ s+=other; } }else{ s+=last; } break; } temp=s+combi+combi; temp+=s+combi+other; temp+=s+combi+last; temp+=s+other; x=press(temp); if(x==size+2){ s+=combi; }else{ if(x==size+1){ s+=other; }else{ s+=last; } } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...