# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
145563 | surface03 | 물통 (KOI17_bucket) | C++14 | 17 ms | 5168 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
const int LM=(int)1e5+5;
bool used[4][LM];
int a,b,c,d;
struct State{
int L,R,S;
}que[LM*4];
int fr,re;
int push(int L,int R,int S){
int i,j;
if(L>=a)R+=L-a,L=a,i=1,j=R;
else if(R>=b)L+=R-b,R=b,i=3,j=L;
else if(L==0)i=0,j=R;
else if(R==0)i=2,j=L;
if(used[i][j])return 0;
if(L==c&&R==d)return 1;
used[i][j]=1;
que[re++]={L,R,S};
return 0;
}
int bfs(){
push(0,0,0);
if(c==0&&d==0)return 0;
while(fr<re){
State&t=que[fr++];
if(push(0,t.R,t.S+1))return t.S+1;
if(push(0,t.L+t.R,t.S+1))return t.S+1;
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |