Submission #707741

#TimeUsernameProblemLanguageResultExecution timeMemory
707741zeta7532Combo (IOI18_combo)C++14
97 / 100
35 ms576 KiB
#include "combo.h" #include <bits/stdc++.h> #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") using namespace std; using ll = int64_t; const ll mod = 998244353; const ll INF = 1LL<<60; #define fi first #define se second #define rep(i,n) for(ll i=0;i<n;i++) #define all(x) x.begin(),x.end() #define faster ios::sync_with_stdio(false);cin.tie(nullptr) string guess_sequence(int N){ string s=""; if(N<=2){ rep(i,N){ if(press(s+'A'+s+'B')>=i+1){ if(press(s+'A')>=i+1){ s+='A'; continue; } else s+='B'; continue; } else if(press(s+'X')>=i+1){ s+='X'; continue; } else s+='Y'; } return s; } rep(i,1){ if(press(s+'A'+s+'B')>=i+1){ if(press(s+'A')>=i+1){ s+='A'; continue; } else s+='B'; continue; } else if(press(s+'X')>=i+1){ s+='X'; continue; } else s+='Y'; } vector<char> v; char c[4]; c[0]='A'; c[1]='B'; c[2]='X'; c[3]='Y'; rep(i,4){ if(s[0]!=c[i]) v.push_back(c[i]); } for(ll i=1;i<N-2;i++){ s+=v[press(s+v[1]+s+v[2]+v[0]+s+v[2]+v[1]+s+v[2]+v[2])-i]; } for(ll i=N-2;i<N;i++){ if(press(s+'A'+s+'B')>=i+1){ if(press(s+'A')>=i+1){ s+='A'; continue; } else s+='B'; continue; } else if(press(s+'X')>=i+1){ s+='X'; continue; } else s+='Y'; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...