Submission #705895

#TimeUsernameProblemLanguageResultExecution timeMemory
705895mseebacherCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int n) { string s = ""; while(s.length() != N){ if(press(s+"A") == s.length()+1)){ s += "A"; }else if(press(s+"B") == s.length()+1)){ s += "B"; }else if(press(s+"X") == s.length()+1)){ s += "X"; }else{ s += "Y"; } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:23: error: 'N' was not declared in this scope
    7 |   while(s.length() != N){
      |                       ^
combo.cpp:8:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |   if(press(s+"A") == s.length()+1)){
      |      ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:8:35: error: expected primary-expression before ')' token
    8 |   if(press(s+"A") == s.length()+1)){
      |                                   ^
combo.cpp:10:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |   }else if(press(s+"B") == s.length()+1)){
      |            ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:10:41: error: expected primary-expression before ')' token
   10 |   }else if(press(s+"B") == s.length()+1)){
      |                                         ^
combo.cpp:12:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |   }else if(press(s+"X") == s.length()+1)){
      |            ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:12:41: error: expected primary-expression before ')' token
   12 |   }else if(press(s+"X") == s.length()+1)){
      |                                         ^