| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 101515 | daniel920712 | 콤보 (IOI18_combo) | C++14 | 2 ms | 264 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
