제출 #549505

#제출 시각아이디문제언어결과실행 시간메모리
549505Clan328콤보 (IOI18_combo)C++17
10 / 100
101 ms456 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string buttons = "ABXY"; string guess_sequence(int N) { string S = ""; int curr = 0; for (int i = 0; i < N; i++) { for (int j = 0; j < 4; j++) { string p = S+buttons[j]; while (p.size() < N) p += p[0]; if (press(p) > curr) { curr++; S += buttons[j]; break; } } } return S; }

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

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