CSES - Aalto Competitive Programming 2024 - wk12 - Wed - Results
Submission details
Task:Rabbits
Sender:AleksandrPolitov
Submission time:2024-11-27 16:54:16 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.04 sdetails
#2ACCEPTED0.04 sdetails
#30.04 sdetails
#40.04 sdetails
#50.04 sdetails
#60.04 sdetails
#7ACCEPTED0.04 sdetails
#80.04 sdetails
#90.04 sdetails
#100.04 sdetails
#110.04 sdetails
#12ACCEPTED0.04 sdetails
#13ACCEPTED0.04 sdetails
#140.05 sdetails
#15ACCEPTED0.04 sdetails
#160.04 sdetails
#170.04 sdetails
#18ACCEPTED0.04 sdetails
#19ACCEPTED0.04 sdetails
#20ACCEPTED0.04 sdetails
#210.04 sdetails
#220.04 sdetails
#230.04 sdetails

Code

a,b=map(int, input().split())
fib=[1,1,]
while fib[-1]<=b:
    fib.append(fib[-1]+fib[-2])

#print(fib)
res=[-1, -1]
for i in range(len(fib)):
    if res[0]==-1 and fib[i]>=a:
        res[0]=i+1
    if fib[i]>=a and fib[i]<=b:
        res[1]=i+1

print(res[1]-res[0]+1)
#print(res[0], res[1])


Test details

Test 1

Verdict: ACCEPTED

input
1 1000000000000000000000000000...

correct output
480

user output
480

Test 2

Verdict: ACCEPTED

input
1 1

correct output
2

user output
2

Test 3

Verdict:

input
100000000000000000000000000000...

correct output
0

user output
-481

Test 4

Verdict:

input
708610693340620844512521044951...

correct output
0

user output
-480

Test 5

Verdict:

input
786632967217302919379405189471...

correct output
0

user output
-480

Test 6

Verdict:

input
636957196297222930779072940972...

correct output
0

user output
-480

Test 7

Verdict: ACCEPTED

input
114612974378925787282507968062...

correct output
3

user output
3

Test 8

Verdict:

input
702530369037899946705172780410...

correct output
0

user output
-480

Test 9

Verdict:

input
274453166590443997807512962944...

correct output
0

user output
-478

Test 10

Verdict:

input
855307457139726034048493902602...

correct output
0

user output
-480

Test 11

Verdict:

input
639748223313530085297872188565...

correct output
0

user output
-480

Test 12

Verdict: ACCEPTED

input
432993801671766821076571962007...

correct output
1

user output
1

Test 13

Verdict: ACCEPTED

input
879671727283213079665539196480...

correct output
1

user output
1

Test 14

Verdict:

input
667785392416865594397610159182...

correct output
0

user output
-480

Test 15

Verdict: ACCEPTED

input
781364162388340525444583784264...

correct output
1

user output
1

Test 16

Verdict:

input
655747298541157143247235560738...

correct output
0

user output
-480

Test 17

Verdict:

input
403413620814634912261621439265...

correct output
0

user output
-479

Test 18

Verdict: ACCEPTED

input
447646307232291168178477866864...

correct output
1

user output
1

Test 19

Verdict: ACCEPTED

input
295276605018840332007572176705...

correct output
5

user output
5

Test 20

Verdict: ACCEPTED

input
443559664146440701189824727251...

correct output
2

user output
2

Test 21

Verdict:

input
734298173292503577661407215818...

correct output
0

user output
-480

Test 22

Verdict:

input
864568133527920094870111453259...

correct output
0

user output
-480

Test 23

Verdict:

input
352783378945989078522092015452...

correct output
0

user output
-479