제출 #972912

#제출 시각아이디문제언어결과실행 시간메모리
972912tamir1콤보 (IOI18_combo)C++17
94 / 100
17 ms1812 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { string S,u; vector<string> v; if(press("A")){ S = "A"; u="BXY"; v={"BB","BX","BY","X"}; } else if(press("B")){ S = "B"; u="AXY"; v={"AA","AX","AY","X"}; } else if(press("X")){ S = "X"; u="ABY"; v={"AA","AB","AY","B"}; } else{ S = "Y"; u="ABX"; v={"AA","AB","AX","B"}; } if(N==1) return S; string p(N*4,S[0]); for(int i=1;i<N-1;i++){ p[i]=u[0]; p[i+1]=u[0]; p[N+i]=u[0]; p[N+i+1]=u[1]; p[2*N+i]=u[0]; p[2*N+i+1]=u[2]; p[3*N+i]=u[1]; //cout << p << "\n"; int coin=press(p)-i; //cout << coin << "\n"; p[i]=u[2-coin]; p[N+i]=u[2-coin]; p[2*N+i]=u[2-coin]; p[3*N+i]=u[2-coin]; S+=u[2-coin]; } if(press(S+u[0])==N) S+=u[0]; else if(press(S+u[1])==N) S+=u[1]; else if(press(S+u[2])==N) S+=u[2]; return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...