제출 #76694

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

string s, t, idk;

string guess_sequence(int N){
    if(press("AB")){
        if(press("A")) s = "A", idk="BXY";
        else s = "B", idk="AXY";
    }
    else{
        if(press("X")) s = "X", idk="ABY";
        else s = "Y", idk="ABX";
    }
    for(int i=2;i<N;i++){
        t = s+idk[0]+s+idk[1]+idk[0]+s+idk[1]+idk[1]+s+idk[1]+idk[2];
        assert(t.size() <= 4*N);
        int m = press(t);
        if(m == i-1) s += idk[2];
        else if(m == i) s += idk[0];
        else s += idk[1];
    }
    int a = press(s+idk[0]), b = press(s+idk[1]);
    if(a != N-1) s += idk[0];
    else if(b != N-1) s += idk[1];
    else s += idk[2];
    return s;
}

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

In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from combo.cpp:2:
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:18:25: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   18 |         assert(t.size() <= 4*N);
      |                ~~~~~~~~~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...