Submission #372735

#TimeUsernameProblemLanguageResultExecution timeMemory
372735Carmel_Ab1Combo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "combo.h"
#include "grader.cpp"
using namespace std;
string guess_sequence(int n) {
    string ans;
    while(ans.size()!=n){
        for(char c:"ABXY") {
            if(!ans.empty() && ans[0]==c)continue;
            ll res=press(ans+string(n-ans.size(),c));
            if(res>ans.size()){
                ans+=string(res-ans.size(),c);
                break;
            }
        }
    }
    return ans;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:21: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    7 |     while(ans.size()!=n){
      |           ~~~~~~~~~~^~~
combo.cpp:10:13: error: 'll' was not declared in this scope
   10 |             ll res=press(ans+string(n-ans.size(),c));
      |             ^~
combo.cpp:11:16: error: 'res' was not declared in this scope
   11 |             if(res>ans.size()){
      |                ^~~