제출 #210576

#제출 시각아이디문제언어결과실행 시간메모리
210576grobar콤보 (IOI18_combo)C++14
0 / 100
82 ms204 KiB
#include <bits/stdc++.h> #include <combo.h> using namespace std; string guess_sequence(int n) { string ss=""; int a1=press("A"); if(a1==1) { ss=ss+"A"; for(int i=1;i<n;i++) { if(press(ss+"B")==i+1) { ss=ss+"B"; if(ss.size()==n) { break; } } if(press(ss+"X")==i+1) { ss=ss+"X"; if(ss.size()==n) { break; } } if(press(ss+"Y")==i+1) { ss=ss+"Y"; if(ss.size()==n) { break; } } } } int a2=press("B"); if(a2==1) { ss=ss+"B"; for(int i=1;i<n;i++) { if(press(ss+"A")==i+1) { ss=ss+"A"; if(ss.size()==n) { break; } } if(press(ss+"X")==i+1) { ss=ss+"X"; if(ss.size()==n) { break; } } if(press(ss+"Y")==i+1) { ss=ss+"Y"; if(ss.size()==n) { break; } } } } int a3=press("X"); if(a3==1) { ss=ss+"X"; for(int i=1;i<n;i++) { if(press(ss+"A")==i+1) { ss=ss+"A"; if(ss.size()==n) { break; } } if(press(ss+"B")==i+1) { ss=ss+"B"; if(ss.size()==n) { break; } } if(press(ss+"Y")==i+1) { ss=ss+"Y"; if(ss.size()==n) { break; } } } } int a4=press("Y"); if(a4==1) { ss=ss+"Y"; for(int i=1;i<n;i++) { if(press(ss+"A")==i+1) { ss=ss+"A"; if(ss.size()==n) { break; } } if(press(ss+"X")==i+1) { ss=ss+"X"; if(ss.size()==n) { break; } } if(press(ss+"B")==i+1) { ss=ss+"B"; if(ss.size()==n) { break; } } } } return ss; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:18:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   18 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:26:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   26 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:34:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   34 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:50:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   50 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:58:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   58 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:66:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   66 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:82:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   82 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:90:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   90 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:98:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   98 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:114:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  114 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:122:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  122 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:130:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  130 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...