Submission #139633

#TimeUsernameProblemLanguageResultExecution timeMemory
139633Bazarkuly2003Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; string guess_sequence(int N){ string s,q,t; long long m,k; if(press("AB")==1){ if(press("A")==1){s="A";q="BXY";}else{s="B";q="AXY";}}else if(press("X")==1){s="X";q="ABY";}else{s="Y";q="ABX";} while(s.size()<N){ if(n<11){ if(k==3)k=0; t=s+q[k]; m=press(t); if(m==s.size()+1)s+=q[k]; k++;}else{ t=s+q[0]+q[0]+s+q[0]+q[1]+s+q[0]+q[2]+s+q[1]; m=press(t); if(m==s.size()+0)s+=q[2];else if(m==s.size()+1)s+=q[1];else if(m==s.size()+2)s+=q[0];} } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:15: 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.size()<N){
      |       ~~~~~~~~^~
combo.cpp:12:5: error: 'n' was not declared in this scope
   12 |  if(n<11){
      |     ^
combo.cpp:16:6: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |  if(m==s.size()+1)s+=q[k];
      |     ~^~~~~~~~~~~~
combo.cpp:20:5: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 | if(m==s.size()+0)s+=q[2];else
      |    ~^~~~~~~~~~~~
combo.cpp:21:5: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 | if(m==s.size()+1)s+=q[1];else
      |    ~^~~~~~~~~~~~
combo.cpp:22:5: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 | if(m==s.size()+2)s+=q[0];}
      |    ~^~~~~~~~~~~~