Submission #562047

#TimeUsernameProblemLanguageResultExecution timeMemory
562047nohaxjustsofloCombo (IOI18_combo)C++17
100 / 100
36 ms624 KiB
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> order_set; mt19937 mt_rand(chrono::high_resolution_clock::now().time_since_epoch().count()); //uniform_int_distribution<int> gen(-1e9, 1e8); ///(min, max) //int random() {return gen(mt_rand);} const int mxN = 1e6+50000; const int mod = 1e9+7; const int mxlogN = 34; const int mxK = 26; const ll inf = 2e18; const int K = 100000; const int mxM = 1e6+50000; int press(string p); vector<char> who={'A','B','X','Y'}; string guess_sequence(int n) { char a; int x=press("AB"); if(x>=1) { x=press("A"); if(x==1) a='A'; else a='B'; } else { x=press("X"); if(x==1) a='X'; else a='Y'; } string ans=string(1,a); vector<char> noa; for(char c:who) if(c!=a) noa.push_back(c); for(int i=1; i<n; i++) { if(i+1<n) { string qry; qry+=ans+string(1,noa[0])+string(1,noa[0]); qry+=ans+string(1,noa[0])+string(1,noa[1]); qry+=ans+string(1,noa[0])+string(1,noa[2]); qry+=ans+string(1,noa[1]); int x=press(qry); if(x==i+2) a=noa[0]; else if(x==i+1) a=noa[1]; else a=noa[2]; } else { int x=press(ans+string(1,noa[0])); if(x==n) a=noa[0]; else { x=press(ans+string(1,noa[1])); if(x==n) a=noa[1]; else a=noa[2]; } } ans.push_back(a); } return ans; } /* int main() { ios_base::sync_with_stdio(0); cin.tie(0); ///obrisi main }*/ /** 1 2 1 2 2 3 3 4 */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...