Submission #1272791

#TimeUsernameProblemLanguageResultExecution timeMemory
1272791gazizmadi11Combo (IOI18_combo)C++20
0 / 100
1 ms400 KiB
#include <bits/stdc++.h> #include "combo.h" // #define pb push_back // #define pf push_front // #define F first // #define S second // #define all(v) v.begin(),v.end() // #define pii pair<int,int> // #define tm (tl+tr)/2 // #define TL v+v, tl, tm // #define TR v+v+1, tm+1, tr // #define DA l <= tl && tr <= r // #define NE r < tl || tr < l // #define double long double // #define int long long using namespace std; // // const int N=2e5+7; // const int mod=998244353; // const int inf=2e9; string guess_sequence(int N){ string s=""; int c=press("AB"); if(c==0){ if(press("X")==1)s+="X"; else s+="Y"; } else{ if(press("A")==1)s+="A"; else s+="B"; } string f="ABXY"; for(int i=0; i < 4; i++){ if(f[i]==s[0]){ f.erase(f.begin()+i); break; } } for(int i=2; i <= N; i++){ int x = press(s+f[0] + s+f[1]+f[0] + s+f[1]+f[1] + s+f[1]+f[2]); if(x == 1)s+=f[0]; else if(x == 2)s+=f[1]; else s+=f[2]; } return s; } // void solve(){ // } // signed main(){ // ios_base::sync_with_stdio(0); // cin.tie(0); // int t=1; // cin >> t; // while(t--)solve(); // return 0; // }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...