Submission #136356

#TimeUsernameProblemLanguageResultExecution timeMemory
136356quotitquotCombo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; string ans = ""; std::string guess_sequence(int N) { string p = ""; if( press( "AB" ) == 0 ) { if( press( "X" ) == 1 ) ans = "X"; else ans = "Y"; } else { if( press( "A" ) == 1 ) ans = "A"; else ans = "B"; } if( ans == "A" ) p = "BXY"; if( ans == "B" ) p = "AXY"; if( ans == "X" ) p = "ABY"; if( ans == "Y" ) p = "ABX"; for( int i = 2; i < N; i ++ ) { string p1 = ans; p1 += p[0]; p1 += p[0]; p1 += ans; p1 += p[0]; p1 += p[1]; p1 += ans; p1 += p[0]; p1 += p[2]; p1 += ans; p1 += p[1]; int now = press( p1 ); if( now == i+1 ) ans += p[0]; else if( now == i ) ans += p[1]; else ans += p[2]; } cout << ans << endl; string p1 = ans; p1 += p[0]; p1 += ans; p1 += p[1]; if( press( p1 ) == N ) { p1 = ans; p1 += p[0]; if( press( p1 ) == N ) ans += p[0]; else ans += p[1]; } else ans += p[2]; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...