Submission #185339

#TimeUsernameProblemLanguageResultExecution timeMemory
185339oofsauceCombo (IOI18_combo)C++14
0 / 100
1 ms244 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string search = "ABXY"; int idx = 0; if(press("AB") == 0) idx = 2; if(press(search[idx] + "")) idx ++; // cout << search[idx]; string X = ""; X.push_back(search[idx]); if(N == 1) return X; string ss = ""; for(char c: search) if(c != search[idx]) ss.push_back(c); while(X.size() < N-1) { // string query = ""; cout << (X+ss[1]) + (X+ss[2]+ss[0]) + (X+ss[2]+ss[1]) + (X+ss[2]+ss[2]) << endl; int c = press((X+ss[1]) + (X+ss[2]+ss[0]) + (X+ss[2]+ss[1]) + (X+ss[2]+ss[2]) ); X += ss[c-(X.size())]; } idx = 0; if(press(X+"AB") == N-1) idx = 2; if(press(X + search[idx])) idx ++; X.push_back(search[idx]); // int coins = press(p); return X; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:25:18: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   25 |   while(X.size() < N-1) {
      |         ~~~~~~~~~^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...