제출 #75472

#제출 시각아이디문제언어결과실행 시간메모리
75472sevenkplus콤보 (IOI18_combo)C++14
100 / 100
62 ms640 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> PII; #define fi first #define se second #define pb push_back #define mp make_pair #define pct __builtin_popcount #define INF 1000000007 std::string guess_sequence(int N) { string p = ""; if (press("AB")) { if (press("A")) p = "A"; else p = "B"; } else { if (press("X")) p = "X"; else p = "Y"; } if (N == 1) return p; string s = ""; for (char c : "ABXY") if (p[0] != c) s += c; for (int i = 1; i < N-1; i ++) { int c = press(p+s[0]+s[0] + p+s[0]+s[1] + p+s[0]+s[2] + p+s[1]); if (c == i+2) p += s[0]; if (c == i+1) p += s[1]; if (c == i) p += s[2]; } if (press(p+s[0]) == N) p += s[0]; else if (press(p+s[1]) == N) p += s[1]; else p += s[2]; return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...