제출 #999270

#제출 시각아이디문제언어결과실행 시간메모리
999270Unforgettablepl콤보 (IOI18_combo)C++17
100 / 100
28 ms1668 KiB
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(),x.end() int press(std::string p); std::string guess_sequence(int N) { string curr; if(press("AB")){ if(press("A"))curr="A"; else curr="B"; } else { if(press("X"))curr="X"; else curr="Y"; } vector<string> options; if(curr[0]!='A')options.emplace_back("A"); if(curr[0]!='B')options.emplace_back("B"); if(curr[0]!='X')options.emplace_back("X"); if(curr[0]!='Y')options.emplace_back("Y"); for(int i=2;i<N;i++){ auto ans = press(curr+options[1]+curr+options[2]+options[0]+curr+options[2]+options[1]+curr+options[2]+options[2]); if(ans==i)curr+=options[1]; else if(ans==(i+1))curr+=options[2]; else curr+=options[0]; } if(N==1)return curr; if(press(curr+options[0])==N)curr+=options[0]; else if(press(curr+options[1])==N)curr+=options[1]; else curr+=options[2]; return curr; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...