Submission #234141

#TimeUsernameProblemLanguageResultExecution timeMemory
234141BinyominCombo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std ; string guess_sequence(int N) { vector < char > s, a = { 'A', 'B', 'X', 'Y' } ; char x ; string ans = "", p = ""; int cnt = 1, ok = 1, cc; if( press("AB") ) { if( press("A") ) { ok =1 ; ans ="A"; x = 'A'; s = { 'B', 'X', 'Y' } ; } else { ok =1 ; ans ="B"; x = 'B'; s = {'A', 'X', 'Y' }; } } else { if( press("X") ) { ok =1 ; ans ="X"; x = 'X'; s = {'A', 'B', 'Y' }; } else{ ok =1 ; ans ="Y"; x = 'Y'; s = {'A', 'B', 'X'}; } } while( cnt != N ) { p = ans + s[0] + ans + s[1] + ans + s[1] ; cc = press(p) ; if( cc == cnt + 2 ) { cnt ++ ; ans += s[1] ; } else if( cc == cnt + 1 ) { cnt ++ ; ans += s[0] ; } else { cnt ++ ; ans += s[2] ; } } return ans ; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:10: warning: variable 'x' set but not used [-Wunused-but-set-variable]
    8 |     char x ;
      |          ^
combo.cpp:10:18: warning: variable 'ok' set but not used [-Wunused-but-set-variable]
   10 |     int cnt = 1, ok = 1, cc;
      |                  ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...