제출 #526668

#제출 시각아이디문제언어결과실행 시간메모리
526668lcs147콤보 (IOI18_combo)C++17
30 / 100
47 ms468 KiB
#include<bits/stdc++.h> #include"combo.h" using namespace std; string guess_sequence(int n) { set<char> possible = {'A','B','X','Y'}; string res; while(res.size() < n) { auto possible2 = possible; char last = *prev(possible.end()); possible.erase(last); char cur = last; for(char c:possible) { if(press(res+c) == res.size()+1) { cur = c; break; } } res += cur; possible = possible2; if(res.size() == 1) possible.erase(cur); } return res; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:22: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    9 |     while(res.size() < n) {
      |           ~~~~~~~~~~~^~~
combo.cpp:17:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |             if(press(res+c) == res.size()+1) {
      |                ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...