Submission #248756

#TimeUsernameProblemLanguageResultExecution timeMemory
248756rocks03Combo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define pii pair<ll, ll> #define ff first #define ss second #define pb push_back #define ld long double mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); string a[4] = {"A", "B", "X", "Y"}; int press(string p); string guess_sequence(int N){ int res; string ans = ""; for(int i = 0; i < 3; i++){ res = press(a[i]); if(res){ ans += a[i]; swap(a[i], a[0]); break; } } if(!res){ ans = a[3]; swap(a[3], a[0]); } for(int i = 1; i < N; i++){ res = press((ans+a[1]+a[2])); if(res == i){ ans += a[3]; } else if(res == i+1){ ans += a[1]; } else if(res == i+2){ ans += a[1]; ans += a[2]; i++; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...