QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#750320#6749. TargetXfJbUhpyzgaW#AC ✓1ms5032kbC++11660b2024-11-15 14:05:012024-11-15 14:05:02

Judging History

你现在查看的是最新测评结果

  • [2024-11-15 14:05:02]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:5032kb
  • [2024-11-15 14:05:01]
  • 提交

answer

#include<bits/stdc++.h>
#define N 100010
using namespace std;
double x,y;
int a,b,qz[100010],dl[100010],h,t,cz[100010];
int ans[N],an;
int main(){
	cin>>x>>y; x*=100000,y*=100000;
	a=x,b=y;
	for(int i=0; i<=100000; ++i)qz[i]=-2;
	qz[a]=-1; dl[1]=a; h=t=1;
	while(h<=t){
		int x=dl[h++];
		int s1=1ll*x/2;
		if(qz[s1]==-2){qz[s1]=x; cz[s1]=1; dl[++t]=s1;}
		int s2=s1+50000;
		if(qz[s2]==-2){qz[s2]=x; cz[s2]=2; dl[++t]=s2;}
	}
	for(int i=max(0,b-9); i<=min(100000,b+9); ++i){
		if(qz[i]!=-2){
			int x=i;
			while(x!=a){
				ans[++an]=cz[x];
				x=qz[x];
			}
			for(int j=an; j>=1; --j)cout<<ans[j]; return 0; 
		}
	} cout<<"F";
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 4840kb

input:

0.5 0.25

output:

1212222222222211

result:

ok ok

Test #2:

score: 0
Accepted
time: 1ms
memory: 4884kb

input:

1 0.75

output:

11212222222222212

result:

ok ok

Test #3:

score: 0
Accepted
time: 0ms
memory: 5024kb

input:

1 0

output:

11111111111111111

result:

ok ok

Test #4:

score: 0
Accepted
time: 1ms
memory: 4988kb

input:

0.361954 0.578805

output:

221121111212112

result:

ok ok

Test #5:

score: 0
Accepted
time: 1ms
memory: 4976kb

input:

0.144888 0.140086

output:

21221212222111211

result:

ok ok

Test #6:

score: 0
Accepted
time: 1ms
memory: 5020kb

input:

0.514397 0.969399

output:

1121111122222

result:

ok ok

Test #7:

score: 0
Accepted
time: 1ms
memory: 4952kb

input:

0.887873 0.402213

output:

212211221

result:

ok ok

Test #8:

score: 0
Accepted
time: 1ms
memory: 4908kb

input:

0.152004 0.176414

output:

22211121121221211

result:

ok ok

Test #9:

score: 0
Accepted
time: 1ms
memory: 4976kb

input:

0.401831 0.860762

output:

2121212111222122

result:

ok ok

Test #10:

score: 0
Accepted
time: 1ms
memory: 4888kb

input:

0.580629 0.869474

output:

11111211212222122

result:

ok ok

Test #11:

score: 0
Accepted
time: 1ms
memory: 4908kb

input:

0.138673 0.508844

output:

11222221112111112

result:

ok ok

Test #12:

score: 0
Accepted
time: 0ms
memory: 5020kb

input:

0.027182 0.263243

output:

222212122111121

result:

ok ok

Test #13:

score: 0
Accepted
time: 1ms
memory: 4888kb

input:

0.081714 0.212216

output:

1222112112212211

result:

ok ok

Test #14:

score: 0
Accepted
time: 1ms
memory: 4964kb

input:

0.562775 0.388603

output:

2121222122111221

result:

ok ok

Test #15:

score: 0
Accepted
time: 1ms
memory: 4976kb

input:

0.112949 0.147503

output:

2122221221211211

result:

ok ok

Test #16:

score: 0
Accepted
time: 1ms
memory: 4896kb

input:

0.800247 0.150903

output:

212211212211211

result:

ok ok

Test #17:

score: 0
Accepted
time: 1ms
memory: 4952kb

input:

0.300103 0.584619

output:

2211121221212112

result:

ok ok

Test #18:

score: 0
Accepted
time: 1ms
memory: 4972kb

input:

0.844720 0.070148

output:

22122221112111

result:

ok ok

Test #19:

score: 0
Accepted
time: 1ms
memory: 4908kb

input:

0.573320 0.123035

output:

222122222111

result:

ok ok

Test #20:

score: 0
Accepted
time: 1ms
memory: 5028kb

input:

0.467281 0.231366

output:

121221122122211

result:

ok ok

Test #21:

score: 0
Accepted
time: 1ms
memory: 4904kb

input:

0.264769 0.373434

output:

2211211222222121

result:

ok ok

Test #22:

score: 0
Accepted
time: 1ms
memory: 4964kb

input:

0.689729 0.570712

output:

1121211112112112

result:

ok ok

Test #23:

score: 0
Accepted
time: 1ms
memory: 4864kb

input:

0.747218 0.312573

output:

22222222221121

result:

ok ok

Test #24:

score: 0
Accepted
time: 1ms
memory: 4924kb

input:

0.215052 0.203677

output:

222211111212211

result:

ok ok

Test #25:

score: 0
Accepted
time: 1ms
memory: 5032kb

input:

0.607834 0.733102

output:

1222122212

result:

ok ok

Test #26:

score: 0
Accepted
time: 1ms
memory: 4964kb

input:

0.516860 0.252876

output:

1221221211111121

result:

ok ok

Test #27:

score: 0
Accepted
time: 1ms
memory: 4972kb

input:

0.955285 0.457773

output:

1212121121212221

result:

ok ok

Test #28:

score: 0
Accepted
time: 1ms
memory: 4836kb

input:

0.156178 0.353262

output:

22112122112122121

result:

ok ok

Test #29:

score: 0
Accepted
time: 1ms
memory: 4896kb

input:

0.398701 0.040258

output:

1112112112121111

result:

ok ok

Test #30:

score: 0
Accepted
time: 1ms
memory: 5024kb

input:

0.973859 0.000184

output:

121111111111111

result:

ok ok

Test #31:

score: 0
Accepted
time: 1ms
memory: 4904kb

input:

0.882213 0.556709

output:

222112221112

result:

ok ok

Test #32:

score: 0
Accepted
time: 1ms
memory: 4960kb

input:

0.263822 0.460984

output:

22222221212221

result:

ok ok

Test #33:

score: 0
Accepted
time: 1ms
memory: 4836kb

input:

0.443432 0.034841

output:

21122211121111

result:

ok ok