Submission #422017

#TimeUsernameProblemLanguageResultExecution timeMemory
422017Dilshod_ImomovCombo (IOI18_combo)C++17
5 / 100
1 ms200 KiB
# include <bits/stdc++.h> # include "combo.h" using namespace std; string guess_sequence(int n) { string s, t; if ( press("A") ) { s = "A"; t = "BXY"; } else if ( press("B") ) { s = "B"; t = "AXY"; } else if ( press("X") ) { s = "X"; t = "ABY"; } else { s = "Y"; t = "ABX"; } int cur = 1; for ( int i = 1; i < n - 1; i++ ) { string k = s; k += t[0]; for ( int j = 0; j < 3; j++ ) { k += s + t[1] + t[j]; } int get = press(k); if ( get == cur ) { s += t[2]; } else if ( get == cur + 1 ) { s += t[0]; } else { s += t[1]; } cur++; } if ( press( s + t[0] ) == cur + 1 ) { s += t[0]; } else if ( press( s + t[1] ) == cur + 1 ) { s += t[1]; } else { s += t[2]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...