제출 #155579

#제출 시각아이디문제언어결과실행 시간메모리
155579bukanYohandi콤보 (IOI18_combo)C++14
0 / 100
117 ms200 KiB
#include <bits/stdc++.h> #include "combo.h" std::string guess_sequence(int N) { std::string p = ""; for (int i = 0; i < 4 * N; ++i) { p += 'A'; } int coins = press(p); std::string S = ""; while(S.length()<=N){ if(press(S+'A')==S.length()+1){S+='A';continue;} if(press(S+'B')==S.length()+1){S+='B';continue;} if(press(S+'X')==S.length()+1){S+='X';continue;} if(press(S+'Y')==S.length()+1){S+='Y';continue;} } return S; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:19: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   11 |   while(S.length()<=N){
      |         ~~~~~~~~~~^~~
combo.cpp:12:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |    if(press(S+'A')==S.length()+1){S+='A';continue;}
      |       ~~~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:13:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |    if(press(S+'B')==S.length()+1){S+='B';continue;}
      |       ~~~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:14:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |    if(press(S+'X')==S.length()+1){S+='X';continue;}
      |       ~~~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:15:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |    if(press(S+'Y')==S.length()+1){S+='Y';continue;}
      |       ~~~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:9:7: warning: unused variable 'coins' [-Wunused-variable]
    9 |   int coins = press(p);
      |       ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...