제출 #545662

#제출 시각아이디문제언어결과실행 시간메모리
545662aun5x콤보 (IOI18_combo)C++14
10 / 100
54 ms548 KiB
#include "combo.h" using namespace std; string guess_sequence(int N) { string p = "ABXY"; char out = 'Z'; string guess = ""; while (guess.size() != N) { for (char c: p) { if (c != out) { int res = press(guess+c); if (res - guess.size() == 1){ guess += c; if (guess.size() == 1) out = c; break; } } } } return guess; }

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

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