Submission #503839

#TimeUsernameProblemLanguageResultExecution timeMemory
503839WongChun1234Combo (IOI18_combo)C++14
100 / 100
28 ms608 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; int ret; string curr,rem; std::string guess_sequence(int N) { if (press("AB")){ if (press("A")) curr="A",rem="BXY"; else curr="B",rem="AXY"; }else if (press("X")) curr="X",rem="ABY"; else curr="Y",rem="ABX"; for (int i=2;i<N;i++){ ret=press(curr+rem[0]+rem[0]+curr+rem[0]+rem[1]+curr+rem[0]+rem[2]+curr+rem[1]); if (ret==i+1) curr+=rem[0]; else if (ret==i) curr+=rem[1]; else curr+=rem[2]; } if (N>1){ if (press(curr+rem[0])==N) curr+=rem[0]; else if (press(curr+rem[1])==N) curr+=rem[1]; else curr+=rem[2]; } return curr; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...