This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int a, b, c, d, e, n, m;
string s, t, st;
int press(string p);
string guess_sequence(int n) {
st="ABXY";
for (a=0; a<st.length(); a++)
{
string p="";
p=p+st[a];
p=p+st[a];
if (press(p))
{
for (b=0; b<st.length(); b++)
{
if (b==a) continue;
string h="";
h=h+st[a];
for (c=0; c<st.length(); c++)
{
if (c==a) continue;
h=h+st[b];
h=h+st[c];
if (press(h)==3) return h;
}
}
}
}
}
Compilation message (stderr)
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
9 | for (a=0; a<st.length(); a++)
| ~^~~~~~~~~~~~
combo.cpp:16:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
16 | for (b=0; b<st.length(); b++)
| ~^~~~~~~~~~~~
combo.cpp:21:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
21 | for (c=0; c<st.length(); c++)
| ~^~~~~~~~~~~~
combo.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
31 | }
| ^| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |