Submission #936970

#TimeUsernameProblemLanguageResultExecution timeMemory
936970MuntherCarrotCombo (IOI18_combo)C++14
5 / 100
1 ms596 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; // int press(string s) string s = "ABXY"; string guess_sequence(int N){ string ans; int x = 0; if(press("AB")){ if(press("B")) swap(s[0], s[1]); } else{ if(press("X")) swap(s[0], s[2]); else swap(s[0], s[3]); } ans = s[0]; while((int)ans.size() < N - 1){ string f = ans + s[1] + ans + s[2] + s[1] + ans + s[2] + s[2] + ans + s[2] + s[3]; int res = press(f); if(res == (int)ans.size()){ ans += s[3]; } else if(res == (int)ans.size() + 1){ ans += s[1]; } else{ ans += s[2]; } } if(press(ans + s[1]) == N) ans += s[1]; else if(press(ans + s[2]) == N) ans += s[2]; else ans += s[3]; return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:9: warning: unused variable 'x' [-Wunused-variable]
   12 |     int x = 0;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...