Submission #1082665

#TimeUsernameProblemLanguageResultExecution timeMemory
1082665KasymKCombo (IOI18_combo)C++17
0 / 100
1 ms344 KiB
#include "bits/stdc++.h" #include "combo.h" using namespace std; #define ff first #define ss second #define all(v) v.begin(), v.end() #define ll long long #define pb push_back #define pii pair<int, int> #define pli pair<ll, int> #define pll pair<ll, ll> #define tr(i, c) for(auto i = c.begin(); i != c.end(); ++i) #define wr puts("----------------") template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;} template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;} string guess_sequence(int n){ string ans = ""; int x = 0; x = press("A"); if(x){ ans = "A"; for(int i = 1; i < n; ++i){ int s = (int)ans.size(); x = press(ans+"X"+ans+"BX"+ans+"BB"+ans+"BY"); if(x == s+1) ans += "X"; else if(x == s+2) ans += "B"; else ans += "Y"; } return ans; } x = press("B"); if(x){ ans = "B"; for(int i = 1; i < n; ++i){ int s = (int)ans.size(); x = press(ans+"X"+ans+"AX"+ans+"AA"+ans+"AY"); if(x == s+1) ans += "X"; else if(x == s+2) ans += "A"; else ans += "Y"; } return ans; } x = press("X"); if(x){ ans = "X"; for(int i = 1; i < n; ++i){ int s = (int)ans.size(); x = press(ans+"A"+ans+"BA"+ans+"BB"+ans+"BY"); if(x == s+1) ans += "A"; else if(x == s+2) ans += "B"; else ans += "Y"; } return ans; } // s[0] = 'Y' ans = "Y"; for(int i = 1; i < n; ++i){ int s = (int)ans.size(); x = press(ans+"A"+ans+"BA"+ans+"BB"+ans+"BX"); if(x == s+1) ans += "A"; else if(x == s+2) ans += "B"; else ans += "X"; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...