제출 #211219

#제출 시각아이디문제언어결과실행 시간메모리
211219grobar콤보 (IOI18_combo)C++14
0 / 100
76 ms200 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; std::string guess_sequence(int n) { string ss=""; vector<string>v1; vector<string>v2; vector<string>v3; vector<string>v4; string ss1; v1.push_back("BB"); v1.push_back("BX"); v1.push_back("BY"); v1.push_back("XX"); v1.push_back("XY"); v1.push_back("XB"); v1.push_back("YY"); v1.push_back("YX"); v1.push_back("YB"); v2.push_back("AA"); v2.push_back("AB"); v2.push_back("AY"); v2.push_back("BY"); v2.push_back("BB"); v2.push_back("BA"); v2.push_back("XX"); v2.push_back("XA"); v2.push_back("XB"); v3.push_back("BB"); v3.push_back("BX"); v3.push_back("BA"); v3.push_back("XA"); v3.push_back("XX"); v3.push_back("XB"); v3.push_back("AA"); v3.push_back("AB"); v3.push_back("AX"); v4.push_back("AA"); v4.push_back("AX"); v4.push_back("AY"); v4.push_back("XA"); v4.push_back("XX"); v4.push_back("XY"); v4.push_back("YA"); v4.push_back("YY"); v4.push_back("YX"); if(press("A")==1) { ss=ss+"A"; if(press("AB")==2) { ss=ss+"B"; } if(press("AX")==2) { ss=ss+"X"; } if(press("AY")==2) { ss=ss+"Y"; } while(ss.size()!=n) { for(int i=0; i<v1.size(); i++) { ss1=ss+v1[i]; if(press(ss1)==ss1.size()) { ss=ss+v1[i]; if(ss.size()==n) { break; } } } } } if(press("X")==1) ss=ss+"X"; if(press("XB")==2) { ss=ss+"B"; } if(press("XA")==2) { ss=ss+"A"; } if(press("XY")==2) { ss=ss+"Y"; } while(ss.size()!=n) { for(int i=0;i<v2.size(); i++) { ss1=ss+v2[i]; if(press(ss1)==ss1.size()) { ss=ss+v2[i]; if(ss.size()==n) { break; } } } } if(press("Y")==1) { ss=ss+"Y"; if(press("YB")==2) { ss=ss+"B"; } if(press("YX")==2) { ss=ss+"X"; } if(press("YA")==2) { ss=ss+"A"; } while(ss.size()!=n) { for(int i=0;i<v3.size(); i++) { ss1=ss+v3[i]; if(press(ss1)==ss1.size()) { ss=ss+v3[i]; if(ss.size()==n) { break; } } } } } if(press("B")==1) { ss=ss+"B"; if(press("BA")==2) { ss=ss+"A"; } if(press("BX")==2) { ss=ss+"X"; } if(press("BY")==2) { ss=ss+"Y"; } while(ss.size()!=n) { for(int i=0; i<v4.size(); i++) { ss1=ss+v4[i]; if(press(ss1)==ss1.size()) { ss=ss+v4[i]; if(ss.size()==n) { break; } } } } } return ss; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:63:24: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   63 |         while(ss.size()!=n)
      |               ~~~~~~~~~^~~
combo.cpp:65:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   65 |             for(int i=0; i<v1.size(); i++)
      |                          ~^~~~~~~~~~
combo.cpp:68:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   68 |                 if(press(ss1)==ss1.size())
      |                    ~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:71:33: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   71 |                     if(ss.size()==n)
      |                        ~~~~~~~~~^~~
combo.cpp:79:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   79 |     if(press("X")==1)
      |     ^~
combo.cpp:81:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   81 |         if(press("XB")==2)
      |         ^~
combo.cpp:93:24: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   93 |         while(ss.size()!=n)
      |               ~~~~~~~~~^~~
combo.cpp:95:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   95 |             for(int i=0;i<v2.size(); i++)
      |                         ~^~~~~~~~~~
combo.cpp:98:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   98 |                 if(press(ss1)==ss1.size())
      |                    ~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:101:33: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  101 |                     if(ss.size()==n)
      |                        ~~~~~~~~~^~~
combo.cpp:123:24: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  123 |         while(ss.size()!=n)
      |               ~~~~~~~~~^~~
combo.cpp:125:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  125 |             for(int i=0;i<v3.size(); i++)
      |                         ~^~~~~~~~~~
combo.cpp:128:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  128 |                 if(press(ss1)==ss1.size())
      |                    ~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:131:33: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  131 |                     if(ss.size()==n)
      |                        ~~~~~~~~~^~~
combo.cpp:154:24: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  154 |         while(ss.size()!=n)
      |               ~~~~~~~~~^~~
combo.cpp:156:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  156 |             for(int i=0; i<v4.size(); i++)
      |                          ~^~~~~~~~~~
combo.cpp:159:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  159 |                 if(press(ss1)==ss1.size())
      |                    ~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:162:33: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  162 |                     if(ss.size()==n)
      |                        ~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...