CSES - Aalto Competitive Programming 2024 - wk1 - Wed - Results
Submission details
Task:Scorpion and frogs
Sender:aalto2024a_004
Submission time:2024-09-04 17:48:54 +0300
Language:Python3 (CPython3)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.02 sdetails
#2ACCEPTED0.02 sdetails
#3ACCEPTED0.02 sdetails
#4ACCEPTED0.02 sdetails
#50.02 sdetails
#60.02 sdetails
#70.02 sdetails
#80.02 sdetails
#90.02 sdetails
#100.02 sdetails
#110.02 sdetails
#120.02 sdetails
#130.02 sdetails
#140.02 sdetails
#150.02 sdetails
#160.02 sdetails
#170.02 sdetails
#180.02 sdetails
#190.02 sdetails
#200.02 sdetails
#210.02 sdetails
#220.02 sdetails
#230.02 sdetails
#240.02 sdetails
#250.02 sdetails
#260.02 sdetails
#270.02 sdetails
#280.02 sdetails
#290.02 sdetails
#300.02 sdetails
#310.02 sdetails
#320.02 sdetails
#330.02 sdetails
#340.02 sdetails
#350.02 sdetails
#360.02 sdetails
#370.02 sdetails
#380.02 sdetails
#390.02 sdetails
#400.02 sdetails
#410.02 sdetails
#420.02 sdetails
#430.03 sdetails
#440.03 sdetails
#450.03 sdetails
#460.03 sdetails
#470.06 sdetails
#480.09 sdetails
#490.13 sdetails
#500.19 sdetails
#510.24 sdetails
#520.31 sdetails
#530.39 sdetails
#540.47 sdetails
#550.56 sdetails

Code

n = int(input())

number_combinations = [1] * (n + 1)

sums = [0] * (n)

for i in reversed(range(0, n)):
    if i == n - 1:
        sums[i] = 1
    elif i == n - 2:
        sums[i] = 1
    elif i == n - 3:
        sums[i] = sums[i + 2] + 1
    else:
        sums[i] = sums[i + 2] + sums[i + 3] + 1
    premutation_for_i = sums[i]


# print(number_combinations)
print(sum(sums) + 1 % 998244353)

Test details

Test 1

Verdict: ACCEPTED

input
1

correct output
2

user output
2

Test 2

Verdict: ACCEPTED

input
2

correct output
3

user output
3

Test 3

Verdict: ACCEPTED

input
3

correct output
5

user output
5

Test 4

Verdict: ACCEPTED

input
4

correct output
8

user output
8

Test 5

Verdict:

input
5

correct output
13

user output
12

Test 6

Verdict:

input
6

correct output
21

user output
18

Test 7

Verdict:

input
7

correct output
34

user output
26

Test 8

Verdict:

input
8

correct output
55

user output
37

Test 9

Verdict:

input
9

correct output
89

user output
52

Test 10

Verdict:

input
10

correct output
144

user output
72

Test 11

Verdict:

input
11

correct output
233

user output
99

Test 12

Verdict:

input
12

correct output
377

user output
135

Test 13

Verdict:

input
13

correct output
610

user output
183

Test 14

Verdict:

input
14

correct output
987

user output
247

Test 15

Verdict:

input
15

correct output
1597

user output
332

Test 16

Verdict:

input
16

correct output
2584

user output
445

Test 17

Verdict:

input
17

correct output
4181

user output
595

Test 18

Verdict:

input
18

correct output
6765

user output
794

Test 19

Verdict:

input
19

correct output
10946

user output
1058

Test 20

Verdict:

input
20

correct output
17711

user output
1408

Test 21

Verdict:

input
30

correct output
2178309

user output
23799

Test 22

Verdict:

input
40

correct output
267914296

user output
396611

Test 23

Verdict:

input
50

correct output
9216450

user output
6601515

Test 24

Verdict:

input
60

correct output
865709054

user output
109870512

Test 25

Verdict:

input
70

correct output
659095774

user output
1828586959

Test 26

Verdict:

input
80

correct output
343522908

user output
30433357590

Test 27

Verdict:

input
90

correct output
666203437

user output
506505428742

Test 28

Verdict:

input
100

correct output
741707250

user output
8429820731097

Test 29

Verdict:

input
200

correct output
319277240

user output
13745504463991726018583220

Test 30

Verdict:

input
300

correct output
12089690

user output
224131566962395256067065314343...

Test 31

Verdict:

input
400

correct output
356073916

user output
365464646573111811763847557723...

Test 32

Verdict:

input
500

correct output
831535149

user output
595919663191481338622684302789...

Test 33

Verdict:

input
600

correct output
627858041

user output
971695205837662772728049971957...

Test 34

Verdict:

input
700

correct output
894762479

user output
158442761897002466187165913827...

Test 35

Verdict:

input
800

correct output
695610340

user output
258353737331747826643069878281...
Truncated

Test 36

Verdict:

input
900

correct output
120428339

user output
421266663078438243802063893694...
Truncated

Test 37

Verdict:

input
1000

correct output
506723686

user output
686909364091612558343364252898...
Truncated

Test 38

Verdict:

input
2000

correct output
118272245

user output
912689131347083082980302629441...
Truncated

Test 39

Verdict:

input
3000

correct output
50602578

user output
121268029528273592088812378733...
Truncated

Test 40

Verdict:

input
4000

correct output
38687300

user output
161127534892028550885190425891...
Truncated

Test 41

Verdict:

input
5000

correct output
644069919

user output
214088433706501589304813926598...
Truncated

Test 42

Verdict:

input
6000

correct output
905964874

user output
284457013989671981533357318497...
Truncated

Test 43

Verdict:

input
7000

correct output
917351342

user output
377954994611477384368026275928...
Truncated

Test 44

Verdict:

input
8000

correct output
606465604

user output
502184762288717803078658359838...
Truncated

Test 45

Verdict:

input
9000

correct output
676429656

user output
667247527008385643902020194394...
Truncated

Test 46

Verdict:

input
10000

correct output
634342956

user output
886564658532668358450088923528...
Truncated

Test 47

Verdict:

input
20000

correct output
215568895

user output
152035439855913654065265222673...
Truncated

Test 48

Verdict:

input
30000

correct output
54808147

user output
260722946146283801479941869348...
Truncated

Test 49

Verdict:

input
40000

correct output
242971895

user output
(empty)

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

Test 50

Verdict:

input
50000

correct output
575576968

user output
(empty)

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

Test 51

Verdict:

input
60000

correct output
923159168

user output
(empty)

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

Test 52

Verdict:

input
70000

correct output
621454924

user output
(empty)

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

Test 53

Verdict:

input
80000

correct output
562709198

user output
(empty)

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

Test 54

Verdict:

input
90000

correct output
389404104

user output
(empty)

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

Test 55

Verdict:

input
100000

correct output
66655788

user output
(empty)

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