CSES - Aalto Competitive Programming 2024 - wk12 - Wed - Results
Submission details
Task:Rabbits
Sender:ZDHKLV
Submission time:2024-11-27 16:47:58 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.04 sdetails
#20.07 sdetails
#30.07 sdetails
#40.07 sdetails
#50.07 sdetails
#60.07 sdetails
#70.04 sdetails
#80.07 sdetails
#90.07 sdetails
#100.07 sdetails
#110.07 sdetails
#120.04 sdetails
#130.07 sdetails
#140.07 sdetails
#150.07 sdetails
#160.07 sdetails
#170.07 sdetails
#180.04 sdetails
#190.04 sdetails
#200.04 sdetails
#210.07 sdetails
#220.07 sdetails
#230.07 sdetails

Code

import math

R1 = (1 - 5**0.5) / 2
R2 = (1 + 5**0.5) / 2

BETA = (1 - math.exp(R1)) / (math.exp(R2) - math.exp(R1))
ALPHA = 1 - BETA

def f(n):
    return ALPHA * math.exp(R1 * n) + BETA * math.exp(R2 * n)

a, b = [ int(e) for e in input().split() ]
n = 0

while not (a <= 2 * f(n) <= b):
    n += 1

print(n)

"""
# a, b = [ int(e) for e in input().split() ]

pairs = 1
month = 0
incoming_pairs = 0

print(R1**R1 - R1 - 1)

while not (a <= 2 * pairs <= b):
    month += 1
    q = pairs
    pairs += incoming_pairs
    incoming_pairs = q

print(month)
"""

Test details

Test 1

Verdict:

input
1 1000000000000000000000000000...

correct output
480

user output
0

Test 2

Verdict:

input
1 1

correct output
2

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 3

Verdict:

input
100000000000000000000000000000...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 4

Verdict:

input
708610693340620844512521044951...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 5

Verdict:

input
786632967217302919379405189471...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 6

Verdict:

input
636957196297222930779072940972...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 7

Verdict:

input
114612974378925787282507968062...

correct output
3

user output
142

Test 8

Verdict:

input
702530369037899946705172780410...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 9

Verdict:

input
274453166590443997807512962944...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 10

Verdict:

input
855307457139726034048493902602...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 11

Verdict:

input
639748223313530085297872188565...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 12

Verdict:

input
432993801671766821076571962007...

correct output
1

user output
143

Test 13

Verdict:

input
879671727283213079665539196480...

correct output
1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 14

Verdict:

input
667785392416865594397610159182...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 15

Verdict:

input
781364162388340525444583784264...

correct output
1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 16

Verdict:

input
655747298541157143247235560738...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 17

Verdict:

input
403413620814634912261621439265...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 18

Verdict:

input
447646307232291168178477866864...

correct output
1

user output
143

Test 19

Verdict:

input
295276605018840332007572176705...

correct output
5

user output
142

Test 20

Verdict:

input
443559664146440701189824727251...

correct output
2

user output
143

Test 21

Verdict:

input
734298173292503577661407215818...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 22

Verdict:

input
864568133527920094870111453259...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...

Test 23

Verdict:

input
352783378945989078522092015452...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 15, in <module>
    while...