Submission #503838

#TimeUsernameProblemLanguageResultExecution timeMemory
503838WongChun1234Combo (IOI18_combo)C++14
97 / 100
35 ms572 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; int ret; string curr,rem; std::string guess_sequence(int N) { if (press("A")) curr="A",rem="BXY"; else if (press("B")) 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...