Submission #957415

#TimeUsernameProblemLanguageResultExecution timeMemory
957415inkvizytorCombo (IOI18_combo)C++14
100 / 100
17 ms2140 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string s = ""; string d = ""; if (press("AB")) { if (press("A")) { s = "A"; d = "BXY"; } else { s = "B"; d = "AXY"; } } else { if (press("X")) { s = "X"; d = "ABY"; } else { s = "Y"; d = "ABX"; } } if (N == 1) { return s; } for (int i = 1; i < N-1; i++) { string p = s+d[0]+d[0]+s+d[0]+d[1]+s+d[0]+d[2]+s+d[1]; int x = press(p); if (x == (int)(s.size()+2)) { s.push_back(d[0]); } else if (x == (int)(s.size()+1)) { s.push_back(d[1]); } else { s.push_back(d[2]); } } if (press(s+d[0]) == N) { s.push_back(d[0]); } else if (press(s+d[1]) == N) { s.push_back(d[1]); } else { s.push_back(d[2]); } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...