CSES - Aalto Competitive Programming 2024 - wk1 - Wed - Results
Submission details
Task:Scorpion and frogs
Sender:aalto2024a_004
Submission time:2024-09-04 17:21:36 +0300
Language:C++ (C++11)
Status:READY
Result:
Test results
testverdicttime
#10.00 sdetails
#20.00 sdetails
#30.00 sdetails
#4ACCEPTED0.00 sdetails
#50.00 sdetails
#60.00 sdetails
#70.00 sdetails
#80.00 sdetails
#90.00 sdetails
#100.00 sdetails
#110.00 sdetails
#120.00 sdetails
#130.00 sdetails
#140.00 sdetails
#150.00 sdetails
#160.00 sdetails
#170.00 sdetails
#180.00 sdetails
#190.00 sdetails
#200.00 sdetails
#210.00 sdetails
#220.00 sdetails
#230.00 sdetails
#240.00 sdetails
#250.00 sdetails
#260.00 sdetails
#270.00 sdetails
#280.00 sdetails
#290.00 sdetails
#300.00 sdetails
#310.00 sdetails
#320.00 sdetails
#330.00 sdetails
#340.00 sdetails
#350.00 sdetails
#360.00 sdetails
#370.00 sdetails
#380.00 sdetails
#390.00 sdetails
#400.00 sdetails
#410.00 sdetails
#420.00 sdetails
#430.00 sdetails
#440.00 sdetails
#450.00 sdetails
#460.00 sdetails
#470.00 sdetails
#480.00 sdetails
#490.00 sdetails
#500.00 sdetails
#510.00 sdetails
#520.00 sdetails
#530.00 sdetails
#540.01 sdetails
#550.01 sdetails

Code

#include <iostream>
#include <vector>

using namespace std;

int scorpion_cross_river(int n) {

    vector<long> tb(n + 1);
    tb[n] = 1;

    long sum = 1;

    for (int i = n - 1; i >= 0; i--) {
        tb[i] = sum % 998244353 ;
        
        sum += tb[i];

        sum = (sum + 998244353) % 998244353;
       
    }

    return tb[0];
}


int main() {
    int n;
    cin >> n;
    long result = scorpion_cross_river(n);
    cout << result << endl;
    return 0;
}

Test details

Test 1

Verdict:

input
1

correct output
2

user output
1

Test 2

Verdict:

input
2

correct output
3

user output
2

Test 3

Verdict:

input
3

correct output
5

user output
4

Test 4

Verdict: ACCEPTED

input
4

correct output
8

user output
8

Test 5

Verdict:

input
5

correct output
13

user output
16

Test 6

Verdict:

input
6

correct output
21

user output
32

Test 7

Verdict:

input
7

correct output
34

user output
64

Test 8

Verdict:

input
8

correct output
55

user output
128

Test 9

Verdict:

input
9

correct output
89

user output
256

Test 10

Verdict:

input
10

correct output
144

user output
512

Test 11

Verdict:

input
11

correct output
233

user output
1024

Test 12

Verdict:

input
12

correct output
377

user output
2048

Test 13

Verdict:

input
13

correct output
610

user output
4096

Test 14

Verdict:

input
14

correct output
987

user output
8192

Test 15

Verdict:

input
15

correct output
1597

user output
16384

Test 16

Verdict:

input
16

correct output
2584

user output
32768

Test 17

Verdict:

input
17

correct output
4181

user output
65536

Test 18

Verdict:

input
18

correct output
6765

user output
131072

Test 19

Verdict:

input
19

correct output
10946

user output
262144

Test 20

Verdict:

input
20

correct output
17711

user output
524288

Test 21

Verdict:

input
30

correct output
2178309

user output
536870912

Test 22

Verdict:

input
40

correct output
267914296

user output
721419738

Test 23

Verdict:

input
50

correct output
9216450

user output
32990492

Test 24

Verdict:

input
60

correct output
865709054

user output
840200159

Test 25

Verdict:

input
70

correct output
659095774

user output
876574883

Test 26

Verdict:

input
80

correct output
343522908

user output
191006845

Test 27

Verdict:

input
90

correct output
666203437

user output
933360445

Test 28

Verdict:

input
100

correct output
741707250

user output
441249859

Test 29

Verdict:

input
200

correct output
319277240

user output
491462366

Test 30

Verdict:

input
300

correct output
12089690

user output
731696071

Test 31

Verdict:

input
400

correct output
356073916

user output
272730141

Test 32

Verdict:

input
500

correct output
831535149

user output
308059322

Test 33

Verdict:

input
600

correct output
627858041

user output
394998702

Test 34

Verdict:

input
700

correct output
894762479

user output
851636547

Test 35

Verdict:

input
800

correct output
695610340

user output
80721227

Test 36

Verdict:

input
900

correct output
120428339

user output
99393648

Test 37

Verdict:

input
1000

correct output
506723686

user output
510735315

Test 38

Verdict:

input
2000

correct output
118272245

user output
853604529

Test 39

Verdict:

input
3000

correct output
50602578

user output
10646361

Test 40

Verdict:

input
4000

correct output
38687300

user output
220946367

Test 41

Verdict:

input
5000

correct output
644069919

user output
927604201

Test 42

Verdict:

input
6000

correct output
905964874

user output
691450578

Test 43

Verdict:

input
7000

correct output
917351342

user output
623002455

Test 44

Verdict:

input
8000

correct output
606465604

user output
530463007

Test 45

Verdict:

input
9000

correct output
676429656

user output
546829742

Test 46

Verdict:

input
10000

correct output
634342956

user output
430192466

Test 47

Verdict:

input
20000

correct output
215568895

user output
49216778

Test 48

Verdict:

input
30000

correct output
54808147

user output
471670752

Test 49

Verdict:

input
40000

correct output
242971895

user output
807369562

Test 50

Verdict:

input
50000

correct output
575576968

user output
318869060

Test 51

Verdict:

input
60000

correct output
923159168

user output
610188941

Test 52

Verdict:

input
70000

correct output
621454924

user output
610385559

Test 53

Verdict:

input
80000

correct output
562709198

user output
295664390

Test 54

Verdict:

input
90000

correct output
389404104

user output
143062034

Test 55

Verdict:

input
100000

correct output
66655788

user output
269130694