제출 #1009396

#제출 시각아이디문제언어결과실행 시간메모리
1009396Increedible콤보 (IOI18_combo)C++14
10 / 100
47 ms940 KiB
#include "combo.h" #include <string> using namespace std; string guess_sequence(int N) { string s = ""; int oldcoins = 0; while (s.size() < N) { if (press(s + "A") > oldcoins) { oldcoins++; s += "A"; } else if (press(s + "B") > oldcoins) { oldcoins++; s += "B"; } else if (press(s + "X") > oldcoins) { oldcoins++; s += "X"; } else if (press(s + "Y") > oldcoins) { oldcoins++; s += "Y"; } } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:21: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    7 |     while (s.size() < N) {
      |            ~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...