제출 #761201

#제출 시각아이디문제언어결과실행 시간메모리
761201JANCARAPANCombo (IOI18_combo)C++17
5 / 100
1 ms208 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define fi first #define se second #define sz(a) (long long) a.size() #define endl '\n' #define dbg(a) cerr << #a << " = " << a << endl; #define print(a) for (auto x : a) cerr << x << " "; cerr << endl; const long long INF = 1e18, MOD = 1e9+7; string guess_sequence(int n) { string s = ""; vector<string> a = {"A", "B", "X", "Y"}; int it = 0; if (press(a[1])) it = 1; else if (press(a[2])) it = 2; else if (press(a[3])) it = 3; s += a[it]; int x = (it + 1) % 4, y = (it + 2) % 4, z = (it + 3) % 4; for (int i = 1; i < n - 1; i++) { int ans = press(s+a[x]+a[y] + s+a[x]+a[z] + s+a[x]+a[x] + s+a[y]); if (ans == sz(s) + 2) { s += a[x]; } else if (ans == sz(s) + 1) { s += a[y]; } else { s += a[z]; } } if (press(s + a[x]) == sz(s) + 1) it = x; else if (press(s + a[y]) == sz(s) + 1) it = y; else it = z; s += a[it]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...