Submission #742253

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7422532023-05-16 02:42:08OspleiCombo (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 p = "";
p="AB";
int coins = press(p);
if (coins!=0) {
p="A";
coins = press(p);
if (coins==0) p="B";
} else {
p="X";
coins = press(p);
if (coins==0) p="Y";
}
string S = p;
if (p=="A"){
while (S.size()!=N-1){
p=S;
p+='B';
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:28:20: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   28 |     while (S.size()!=N-1){
      |            ~~~~~~~~^~~~~
combo.cpp:40:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |       if (coins == S.size()) S+='Y';
      |           ~~~~~~^~~~~~~~~~~
combo.cpp:41:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |       else if (coins == S.size()+1) S+='B';
      |                ~~~~~~^~~~~~~~~~~~~
combo.cpp:61:20: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   61 |     while (S.size()!=N-1){
      |            ~~~~~~~~^~~~~
combo.cpp:73:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   73 |       if (coins == S.size()) S+='Y';
      |           ~~~~~~^~~~~~~~~~~
combo.cpp:74:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   74 |       else if (coins == S.size()+1) S+='A';
      |                ~~~~~~^~~~~~~~~~~~~
combo.cpp:94:22: error: 'n' was not declared in this scope
   94 |     while (S.size()!=n-1){
      |                      ^
combo.cpp:106:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  106 |       if (coins == S.size()) S+='Y';
      |           ~~~~~~^~~~~~~~~~~
combo.cpp:107:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  107 |       else if (coins == S.size()+1) S+='B';
      |                ~~~~~~^~~~~~~~~~~~~
combo.cpp:127:22: error: 'n' was not declared in this scope
  127 |     while (S.size()!=n-1){
      |                      ^
combo.cpp:139:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  139 |       if (coins == S.size()) S+='A';
      |           ~~~~~~^~~~~~~~~~~
combo.cpp:140:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  140 |       else if (coins == S.size()+1) S+='B';
      |                ~~~~~~^~~~~~~~~~~~~