제출 #894417

#제출 시각아이디문제언어결과실행 시간메모리
894417AtabayRajabli콤보 (IOI18_combo)C++17
10 / 100
26 ms1480 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string p = "ABXY"; string res = ""; if(press("A"))res = "A"; else if(press("B"))res = "B"; else if(press("X"))res = "X"; else res = "Y"; while(res.size() < N) { for(char c : p) { if(c == res[0])continue; if(press(res + c) == res.size() + 1) { res += c; break; } } } return res; }

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

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