제출 #344929

#제출 시각아이디문제언어결과실행 시간메모리
344929Alma콤보 (IOI18_combo)C++14
0 / 100
0 ms200 KiB
#include <iostream> #include <vector> #include <string> #include <combo.h> using namespace std; string guess_sequence(int N) { string S = ""; vector<char> buttons = {'A', 'B', 'X', 'Y'}; for (int i = 0; i < buttons.size(); i++) { if (press(S + buttons[i]) == 1) { S += buttons[i]; buttons.erase(buttons.begin()+i); } } for (int j = 2; j <= N; j++) { for (char c: buttons) { if (press(S + c) == j) {S += c;} } } return S; }

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

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