제출 #372735

#제출 시각아이디문제언어결과실행 시간메모리
372735Carmel_Ab1콤보 (IOI18_combo)C++17
컴파일 에러
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;
}

컴파일 시 표준 에러 (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()){
      |                ^~~