Submission #99279

#TimeUsernameProblemLanguageResultExecution timeMemory
99279wleung_bvgCombo (IOI18_combo)C++14
30 / 100
71 ms448 KiB
//============================================================================ // Name : ioi18p1.cpp // Author : Daxi the Taxi // Version : // Copyright : ALL YOUR CODE IS BELONG TO US // Description : Hello World in C++, Ansi-style //============================================================================ #include "combo.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> p; #ifndef ONLINE_JUDGE int press(string s); #endif string guess_sequence(int n){ string curr = "", usable = ""; // Guessing first letter int ret = press("AB"); if(ret){ ret = press("A"); if(ret) curr = "A", usable = "BXY"; else curr = "B", usable = "AXY"; } else{ ret = press("X"); if(ret) curr = "X", usable = "ABY"; else curr = "Y", usable = "ABX"; } // Rest of it for (int i = 1; i < n; ++i) { ret = press(curr + usable[0] + curr + usable[1]); if(ret > i){ ret = press(curr + usable[0]); if(ret > i) curr += usable[0]; else curr += usable[1]; } else curr += usable[2]; } return curr; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...