제출 #1189888

#제출 시각아이디문제언어결과실행 시간메모리
1189888MatteoArcari콤보 (IOI18_combo)C++20
30 / 100
8 ms456 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; int press (string p); string guess_sequence(int n) { srand(time(nullptr)); vector<int> ord = {0, 1, 2}; string s = ""; string chars; { if (press("A")) { s = "A"; chars = "BXY"; } else if (press("B")) { s = "B"; chars = "AXY"; } else if (press("X")) { s = "X"; chars = "ABY"; } else { s = "Y"; chars = "ABX"; } } for (int i = 1; i < n; i++) { random_shuffle(ord.begin(), ord.end()); int x; if (i == n - 1) { x = press(s + chars[0]); if (x == n) { s += chars[0]; break; } x = press(s + chars[1]); if (x == n) { s += chars[1]; break; } s += chars[2]; break; } int cnt = 0; for (char j: ord) { char c = chars[j]; x = i + 1; if (++cnt < 3) x = press(s + c); if (x == i + 1) { s += c; break; } } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...