제출 #860492

#제출 시각아이디문제언어결과실행 시간메모리
860492Salty콤보 (IOI18_combo)C++14
5 / 100
1 ms596 KiB
#include "combo.h" //#include "grader.cpp" #include<bits/stdc++.h> #define pb push_back using namespace std; string guess_sequence(int N) { string first=""; // find first string int coin = press("AB"); if(coin == 0) { coin = press("X"); if(coin==1)first = "X"; else first ="Y"; } else { coin = press("A"); if(coin==1)first = "A"; else first ="B"; } vector<string> v; if(first!="A")v.pb("A"); if(first!="B")v.pb("B"); if(first!="X")v.pb("X"); if(first!="Y")v.pb("Y"); for(int i=1;i<N-1;i++){ string s=""; s+=first+v[0]; s+=first+v[1]+v[0]; s+=first+v[1]+v[1]; s+=first+v[1]+v[2]; coin = press(s); if(coin == i+1)first+=v[0]; else if(coin == i+2)first+=v[1]; else first+=v[2]; } string s=""; s+=first+v[0]; s+=first+v[1]; coin = press(s); if(coin!=N)return first+v[2]; s=""; s+=first+v[0]; coin = press(s); if(coin!=N)return first+v[1]; else return first+v[0]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...