제출 #1038527

#제출 시각아이디문제언어결과실행 시간메모리
1038527boyliguanhan콤보 (IOI18_combo)C++17
100 / 100
21 ms1828 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { string str,buton; if(press("AB")) if(press("A")) str="A",buton="BXY"; else str="B",buton="AXY"; else if(press("X")) str="X",buton="ABY"; else str="Y",buton="ABX"; if(N==1)return str; for(int i=2;i<N;i++){ string str2=str+buton[0]+str+buton[1]+buton[0]+str+buton[1]+buton[1]+str+buton[1]+buton[2]; assert(str2.size()<4*N); int k=press(str2); if(k==str.size())str+=buton[2]; else if(k<str.size()+2) str+=buton[0]; else str+=buton[1]; }; if(press(str+buton[0])==N) str+=buton[0]; else if(press(str+buton[1])==N) str+=buton[1]; else str+=buton[2]; return str; }

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

In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from combo.cpp:2:
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:23: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   16 |     assert(str2.size()<4*N);
      |            ~~~~~~~~~~~^~~~
combo.cpp:18:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |     if(k==str.size())str+=buton[2];
      |        ~^~~~~~~~~~~~
combo.cpp:19:14: 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(k<str.size()+2)
      |             ~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...