Submission #375251

#TimeUsernameProblemLanguageResultExecution timeMemory
375251Edbert2397Combo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { std::string p = ""; char s[4] = {'A','B','X','Y'}; do{ for(int i = 0;i<4;i++){ p += s[i]; } int coins = press(p); if(coins == N){ string ans = ""; for(int i = 0;i<3;i++){ ans += s[i]; } int coins = press(ans); if(coins == N) { return ans; } else{ ans = ""; for(int i = 1;i<4;i++){ ans += s[i]; } return ans; } } }while(next_permutation(s,s + 4)); }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:6:19: warning: control reaches end of non-void function [-Wreturn-type]
    6 |   std::string p = "";
      |                   ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...