Submission #745115

#TimeUsernameProblemLanguageResultExecution timeMemory
745115teo_thrashCombo (IOI18_combo)C++14
5 / 100
1 ms208 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int n) { string p="AB"; vector<char> a={'A', 'B', 'X', 'Y'}; string S, curr; vector<char> let; if(!press("AB")){ p="XY"; } char c=p[0]; if(!press(p.substr(0, 1))){ c=p[1]; } S+=c; for(char i: a){ if(i!=c){ let.push_back(i); // cerr<<a[i]<<" "; } } //cerr<<endl; int coins=0; for(int i=2; i<n; i++){ curr=S+let[0]+let[0] + S+let[0]+let[1] + S+let[0]+let[2] + S+let[1]; coins=press(curr); if(coins==i+1){ S+=let[0]; } if(coins==i){ S+=let[1]; } if(coins==i-1){ S+=let[2]; } } if(press(S+let[0])==n){ S+=let[0]; }else{ if(press(S+let[1])==n){ S+=let[1]; }else{ S+=let[2]; } } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...