제출 #292725

#제출 시각아이디문제언어결과실행 시간메모리
292725Hideo콤보 (IOI18_combo)C++11
100 / 100
44 ms780 KiB
#include "combo.h" //#include "grader.cpp" #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back string ar[4] = {"A", "B", "X", "Y"}; string guess_sequence(int N){ string s, t; string a, b, c, d; int n = N; if (press("AB")){ if (press("A")) a = "A"; else a = "B"; } else { if (press("X")) a = "X"; else a = "Y"; } s = a; if (N == 1) return s; int z = 0; for (int i = 0; i < 4; i++){ if (ar[i] != a && z == 0){ b = ar[i]; z++; } else if (ar[i] != a && z == 1){ c = ar[i]; z++; } else if (ar[i] != a) d = ar[i]; } for (int i = 2; i < n; i++){ t = (s + b + b) + (s + b + c) + (s + b + d) + (s + c); int r = press(t); if (r == i + 1) s += b; else if (r == i) s += c; else s += d; } t = (s + b) + (s + c); if (press(t) == n){ if (press(s + b) == n) s += b; else s += c; } else s += d; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...