Submission #1196430

#TimeUsernameProblemLanguageResultExecution timeMemory
1196430ffeyyaae_Combo (IOI18_combo)C++20
0 / 100
0 ms408 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence( int N ) { string s = ""; string a = "ABXY"; vector<char> bt; if( press("A") ) s += "A"; else if( press("B") ) s += "B"; else if( press("X") ) s += "X"; else s += "Y"; if( N == 1 ) return s; for( auto c : a ) if( s[0] != c ) bt.push_back( c ); for( int i=1;i<N;i++ ) { string tp = s+bt[0] + s+bt[1]+bt[0] + s+bt[1]+bt[1] + s+bt[1]+bt[2]; int sz = sizeof(s); if( press(tp) == sz+1 ) s += bt[0]; else if( press(tp) == sz+2 ) s += bt[1]; else s += bt[2]; } if( press(s+bt[0]) ) s += bt[0]; else if( press(s+bt[1]) ) s += bt[1]; else s += bt[2]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...