제출 #295742

#제출 시각아이디문제언어결과실행 시간메모리
295742zoooma13콤보 (IOI18_combo)C++14
5 / 100
1 ms232 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { string ret; if(press("AB")) ret = press("A")? "A" : "B"; else ret = press("X")? "X" : "Y"; string Cs = "ABXY"; Cs.erase(find(Cs.begin() ,Cs.end() ,ret[0])); while(ret.size() < N-1){ int coins = press(ret+Cs[0] + ret+Cs[1]+Cs[0] + ret+Cs[1]+Cs[1] + ret+Cs[1]+Cs[2]); if(coins == ret.size()) ret += Cs[2]; else if(coins-1 == ret.size()) ret += Cs[0]; else ret += Cs[1]; } if(press(ret+Cs[0]) == N) ret += Cs[0]; else if(press(ret+Cs[1]) == N) ret += Cs[1]; else ret += Cs[2]; return ret; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:15:22: 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(ret.size() < N-1){
      |           ~~~~~~~~~~~^~~~~
combo.cpp:17:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |         if(coins == ret.size())
      |            ~~~~~~^~~~~~~~~~~~~
combo.cpp:19:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |         else if(coins-1 == ret.size())
      |                 ~~~~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...