제출 #440923

#제출 시각아이디문제언어결과실행 시간메모리
440923beferith콤보 (IOI18_combo)C++14
30 / 100
42 ms444 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;

string guess_sequence(int N){
    vector<string> chr = {"A","B","X","Y"};

    string curr = "";
    for(int i=0;i<N;i++){
        bool found = false;
        for(int j=0;j<chr.size()-1;j++){
            if(press(curr + chr[j]) == i+1){
                curr += chr[j];
                found = true;
                break;
            }
        }
        if(!found){
            curr += chr[chr.size()-1];
        }
        if(!i){
            chr.erase(find(chr.begin(),chr.end(),curr));
        }
    }
    return curr;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |         for(int j=0;j<chr.size()-1;j++){
      |                     ~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...