| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 101515 | daniel920712 | Combo (IOI18_combo) | C++14 | 2 ms | 264 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 <string>
#include <stdio.h>
#include <iostream>
#include "combo.h"
using namespace std;
string all;
string aaa;
bool have[4]={0};
bool can[5][2005]={0};
char change1[4][4]={"A","B","X","Y"};
char change[4]={'A','B','X','Y'};
string guess_sequence(int N)
{
int con=0,i,j,k,t,x=0,a,b;
for(i=0;i<N;i++)
{
/*if(i==0)
{
for(j=0;j<4;j++)
{
if(j==3) all+='Y';
else if(press(change1[j])==1)
{
all+=change[j];
break;
}
}
continue;
}*/
t=0;
con=0;
for(j=0;j<4;j++)
{
if(i==1&&change[j]==all[0]) for(k=i;k<N;k++) can[j][k]=1;
t+=(1-can[j][i]);
}
for(j=0;j<4;j++)
{
if(can[j][i]) continue;
//con=0;
if(con+1==t) all+=change[j];
else
{
con++;
a=-1;
b=-1;
for(k=0;k<4;k++)
{
if(can[k][i+1]) continue;
if(a==-1&&(i||j!=k)) a=k;
}
aaa=all;
aaa+=change[j];
aaa+=change[a];
x=press(aaa);
//printf("a:%d %d\n",x,i);
if(x==i+1)
{
all+=change[j];
can[a][i+1]=1;
break;
}
else if(x==i+2)
{
all+=change[j];
all+=change[a];
i++;
break;
}
}
}
//std::cout<<i<<" "<<all<<'\n';
}
return all;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
