제출 #787174

#제출 시각아이디문제언어결과실행 시간메모리
787174resolve100콤보 (IOI18_combo)C++14
5 / 100
1 ms256 KiB
#include<bits/stdc++.h>
#include "combo.h"
#define ll long long
#define ull unsigned ll
#define pb push_back
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)

using namespace std;

string chars[] = {"A", "B", "X", "Y"};
string guess_sequence(int N){

    string out;
    for (int i = 0; i < 3; i++){
        for (int j = 0; j < 3; j++){
            int num = press(out+chars[j]);
            if (num == i+1) {
                out.append(chars[j]);
                break;
            }
        }
        if (out.size() == i) out.append(chars[3]);
    }

    return out;
}

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:22:24: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   22 |         if (out.size() == i) out.append(chars[3]);
      |             ~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...