QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#406750#6749. Targetpoxiao01TL 9ms9336kbPython3217b2024-05-07 17:24:392024-05-07 17:25:19

Judging History

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

  • [2024-05-07 17:25:19]
  • 评测
  • 测评结果:TL
  • 用时:9ms
  • 内存:9336kb
  • [2024-05-07 17:24:39]
  • 提交

answer

a, b = map(float, input().split())
eps = 1e-4
str = ''
while abs(a - b) > eps:
    if a - b >= 0.0000000:
        str += '1'
        a *= 0.5
    else:
        str += '2'
        a = a * 0.5 + 0.5
print(str)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 7ms
memory: 9328kb

input:

0.5 0.25

output:

1

result:

ok ok

Test #2:

score: 0
Accepted
time: 9ms
memory: 9336kb

input:

1 0.75

output:

12

result:

ok ok

Test #3:

score: 0
Accepted
time: 4ms
memory: 9296kb

input:

1 0

output:

11111111111111

result:

ok ok

Test #4:

score: -100
Time Limit Exceeded

input:

0.361954 0.578805

output:


result: