Submission #92975

#TimeUsernameProblemLanguageResultExecution timeMemory
92975beso123콤보 (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
//#include "combo.h"

using namespace std;
string a="ABXY";
string s1(string s){
    for(int k=0;k<a.size();k++)
if(press(a[k])==1){
s+=a[k];
break;
}
return s;
}
string s2(string s){
    for(int k=0;k<a.size();k++){
    string b=s+a[k];
if(press(b)==2){
s=b;
break;
}
}
return s;
}
string s3(string s){
    for(int k=0;k<a.size();k++){
    string b=s+a[k];
if(press(b)==3){
s=b;
break;
}
}
return s;
}
string guess_sequence(int N){
    string s;
s=s1(s);
s=s2(s);
s=s3(s);
return s;
}

Compilation message (stderr)

combo.cpp: In function 'std::string s1(std::string)':
combo.cpp:7:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |     for(int k=0;k<a.size();k++)
      |                 ~^~~~~~~~~
combo.cpp:8:4: error: 'press' was not declared in this scope
    8 | if(press(a[k])==1){
      |    ^~~~~
combo.cpp: In function 'std::string s2(std::string)':
combo.cpp:15:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |     for(int k=0;k<a.size();k++){
      |                 ~^~~~~~~~~
combo.cpp:17:4: error: 'press' was not declared in this scope
   17 | if(press(b)==2){
      |    ^~~~~
combo.cpp: In function 'std::string s3(std::string)':
combo.cpp:25:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |     for(int k=0;k<a.size();k++){
      |                 ~^~~~~~~~~
combo.cpp:27:4: error: 'press' was not declared in this scope
   27 | if(press(b)==3){
      |    ^~~~~