Submission #99900

#TimeUsernameProblemLanguageResultExecution timeMemory
999001KhanCombo (IOI18_combo)C++14
5 / 100
2 ms200 KiB
// In the name of GOD #include "combo.h" #include <bits/stdc++.h> using namespace std; #define nl '\n' string guess_sequence(int N){ string s; if(N == 1){ int p = press("A"); if(p){ s += 'A'; return s; } p = press("B"); if(p){ s += 'B'; return s; } p = press("X"); if(p){ s += 'x'; return s; } p = press("Y"); if(p){ s += 'y'; return s; } } if(N == 2){ string k[111]; k[1] = "AB"; k[2] = "AX"; k[3] = "AY"; k[4] = "BX"; k[5] = "BY"; k[6] = "BA"; k[7] = "XA"; k[8] = "XY"; k[9] = "XB"; k[10] = "YA"; k[11] = "YB"; k[12] = "YX"; int w = 0; for(int i = 0; i <= 12; ++i){ w = max(w, press(k[i])); if(w == press(k[i])){ s = k[i]; } return k[i]; } } if(N == 3){ string k[] = { "ABX", "ABY", "ABB", "AXY", "AXB", "AXX", "AYX", "AYB", "AYY", "BAX", "BAY", "BAA", "BXA", "BXY", "BXX", "BYA", "BYX", "BYY", "XAB", "XAY", "XAA", "XBA", "XBY", "XBB", "XYA", "XYB", "XYY", "YAB", "YAX", "YAA", "YBA", "YBX", "YBB", "YXA", "YXB", "YXX", }; int w = 0; for(int i = 0; i <= 35; ++i){ int val = press(k[i]); w = max(w, val); if(w == val){ s = k[i]; } } return s; } else{ s += "ABXY"; return s; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...