# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
154038 | mohamedsobhi777 | 콤보 (IOI18_combo) | C++14 | 89 ms | 536 KiB |
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 "combo.h"
using namespace std;
std::string guess_sequence(int N) {
string ret = "";
string chs = "ABXY";
for(int i = 0;i<3;i++)
{
if(press( string(1 , chs[i] ) ))
{
ret+=chs[i];
break;
}
}
if(!ret.size())
ret+=chs[3];
for(int i = 1;i<N;i++)
{
bool ok = 0;
for(int j = 0;j<3;j++)
{
string ask = ret;
ask+=chs[j];
if( press( ask ) ==i+1 )
{
ret+=chs[j];
ok = 1;
break;
}
}
if(ret.size()==i)
ret+=chs[3];
}
return ret;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |