Submission details
Task:Perfect run
Sender:aalto26kw_003
Submission time:2026-11-18 16:51:10 +0200
Language:Rust (2021)
Status:READY
Result:
Test results
testverdicttime
#10.00 sdetails
#20.00 sdetails
#30.00 sdetails
#40.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.00 sdetails
#550.00 sdetails
#560.00 sdetails
#570.00 sdetails
#580.00 sdetails
#590.00 sdetails
#600.00 sdetails
#610.00 sdetails
#620.00 sdetails
#630.00 sdetails
#640.00 sdetails
#650.00 sdetails
#660.00 sdetails
#670.00 sdetails
#680.00 sdetails
#690.00 sdetails
#700.00 sdetails

Code

#![allow(unused)]

use std::cmp::max;
use std::collections::*;
use std::io;

fn take_tuple() -> (usize, usize) {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    let mut it = input.trim().split_whitespace().map(|x| x.parse::<usize>().unwrap());
    (it.next().unwrap(), it.next().unwrap())
}

const M: u64 = 998244353;

fn mul_mod(p: &[u64], q: &[u64], a: usize) -> Vec<u64> {
    let mut r = vec![0u64; 2 * a - 1];
    for (i, &pi) in p.iter().enumerate() {
        if pi == 0 {
            continue;
        }
        for (j, &qj) in q.iter().enumerate() {
            r[i + j] = (r[i + j] + pi * qj) % M;
        }
    }
    for d in (a..r.len()).rev() {
        let c = r[d];
        r[d - 1] = (r[d - 1] + c) % M;
        r[d - a] = (r[d - a] + c) % M;
    }
    r.truncate(a);
    r
}

fn main() {
    let (a, b) = take_tuple();

    let mut res = vec![0u64; a];
    res[0] = 1;
    let mut base = vec![0u64; a];
    if a == 1 {
        base[0] = 2;
    } else {
        base[1] = 1;
    }

    let mut e = b;
    while e > 0 {
        if e & 1 == 1 {
            res = mul_mod(&res, &base, a);
        }
        base = mul_mod(&base, &base, a);
        e >>= 1;
    }

    let ans = res.iter().fold(0, |s, &c| (s + c) % M);
    println!("{ans}");
}

Test details

Test 1

Verdict:

input
1
65 

correct output
153576058

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 2

Verdict:

input
1
26 

correct output
383940151

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 3

Verdict:

input
1
83 

correct output
120270406

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 4

Verdict:

input
1
56 

correct output
71303173

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 5

Verdict:

input
2
21 43 

correct output
337170047

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 6

Verdict:

input
2
63 91 

correct output
141387484

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 7

Verdict:

input
2
21 100 

correct output
522889920

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 8

Verdict:

input
2
55 76 

correct output
429865997

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 9

Verdict:

input
2
5 89 

correct output
628108904

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 10

Verdict:

input
2
50 39 

correct output
588708223

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 11

Verdict:

input
3
16 82 16 

correct output
888681005

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 12

Verdict:

input
3
42 100 73 

correct output
541773855

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 13

Verdict:

input
3
16 45 75 

correct output
859599341

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 14

Verdict:

input
3
52 67 95 

correct output
635416411

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 15

Verdict:

input
3
97 91 55 

correct output
753898258

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 16

Verdict:

input
3
23 6 88 

correct output
74309461

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 17

Verdict:

input
4
90 95 34 21 

correct output
565470703

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 18

Verdict:

input
4
12 86 98 91 

correct output
10046506

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 19

Verdict:

input
4
37 84 46 90 

correct output
571617009

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 20

Verdict:

input
4
30 41 81 60 

correct output
360101423

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 21

Verdict:

input
4
93 66 88 9 

correct output
166699384

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 22

Verdict:

input
5
36 48 35 83 94 

correct output
179015479

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 23

Verdict:

input
5
89 92 79 24 43 

correct output
980334799

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 24

Verdict:

input
5
56 8 71 84 30 

correct output
730439108

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 25

Verdict:

input
5
52 93 78 66 88 

correct output
431191434

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 26

Verdict:

input
5
23 6 88 84 21 

correct output
977482945

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 27

Verdict:

input
5
90 95 34 21 83 

correct output
685741109

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 28

Verdict:

input
5
8 23 78 32 44 

correct output
455631822

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 29

Verdict:

input
5
88 2 97 24 87 

correct output
519774700

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 30

Verdict:

input
5
2 37 51 50 50 

correct output
483516616

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 31

Verdict:

input
10
55 60 72 85 61 86 55 85 43 63 

correct output
155971367

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 32

Verdict:

input
10
42 100 73 94 1 13 31 100 15 24...

correct output
865571866

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 33

Verdict:

input
10
44 19 3 94 55 95 44 49 43 33 

correct output
690840298

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 34

Verdict:

input
10
56 8 71 84 30 13 52 57 90 44 

correct output
382913125

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 35

Verdict:

input
10
97 91 55 18 98 86 72 61 70 60 

correct output
578788309

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 36

Verdict:

input
10
23 6 88 84 21 37 92 98 49 9 

correct output
404411049

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 37

Verdict:

input
10
90 95 34 21 83 7 5 38 11 99 

correct output
865572387

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 38

Verdict:

input
10
8 23 78 32 44 98 73 46 98 31 

correct output
39915528

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 39

Verdict:

input
10
88 2 97 24 87 38 54 82 24 43 

correct output
243950411

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 40

Verdict:

input
10
2 37 51 50 50 1 14 32 15 2 

correct output
477575500

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 41

Verdict:

input
100
55 60 72 85 61 86 55 85 43 63 ...

correct output
768902

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 42

Verdict:

input
100
42 100 73 94 1 13 31 100 15 24...

correct output
89425172

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 43

Verdict:

input
100
44 19 3 94 55 95 44 49 43 33 3...

correct output
84130893

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 44

Verdict:

input
100
56 8 71 84 30 13 52 57 90 44 9...

correct output
708013405

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 45

Verdict:

input
100
97 91 55 18 98 86 72 61 70 60 ...

correct output
858305627

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 46

Verdict:

input
100
23 6 88 84 21 37 92 98 49 9 62...

correct output
165441381

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 47

Verdict:

input
100
90 95 34 21 83 7 5 38 11 99 60...

correct output
306956928

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 48

Verdict:

input
100
8 23 78 32 44 98 73 46 98 31 5...

correct output
66655283

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 49

Verdict:

input
100
88 2 97 24 87 38 54 82 24 43 2...

correct output
842227623

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 50

Verdict:

input
100
2 37 51 50 50 1 14 32 15 2 22 ...

correct output
512304517

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 51

Verdict:

input
200
55 60 72 85 61 86 55 85 43 63 ...

correct output
676541360

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 52

Verdict:

input
200
42 100 73 94 1 13 31 100 15 24...

correct output
739616457

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 53

Verdict:

input
200
44 19 3 94 55 95 44 49 43 33 3...

correct output
680607517

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 54

Verdict:

input
200
56 8 71 84 30 13 52 57 90 44 9...

correct output
69478296

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 55

Verdict:

input
200
97 91 55 18 98 86 72 61 70 60 ...

correct output
810350619

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 56

Verdict:

input
200
23 6 88 84 21 37 92 98 49 9 62...

correct output
271509879

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 57

Verdict:

input
200
90 95 34 21 83 7 5 38 11 99 60...

correct output
260281729

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 58

Verdict:

input
200
8 23 78 32 44 98 73 46 98 31 5...

correct output
95628936

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 59

Verdict:

input
200
88 2 97 24 87 38 54 82 24 43 2...

correct output
653095398

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 60

Verdict:

input
200
2 37 51 50 50 1 14 32 15 2 22 ...

correct output
634589250

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 61

Verdict:

input
1000
55 60 72 85 61 86 55 85 43 63 ...

correct output
333780085

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 62

Verdict:

input
1000
42 100 73 94 1 13 31 100 15 24...

correct output
552341913

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 63

Verdict:

input
1000
44 19 3 94 55 95 44 49 43 33 3...

correct output
390722203

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 64

Verdict:

input
1000
56 8 71 84 30 13 52 57 90 44 9...

correct output
8321130

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 65

Verdict:

input
1000
97 91 55 18 98 86 72 61 70 60 ...

correct output
860563428

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 66

Verdict:

input
100000
23 6 88 84 21 37 92 98 49 9 62...

correct output
742189691

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 67

Verdict:

input
100000
90 95 34 21 83 7 5 38 11 99 60...

correct output
318788252

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 68

Verdict:

input
100000
8 23 78 32 44 98 73 46 98 31 5...

correct output
417579105

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 69

Verdict:

input
100000
88 2 97 24 87 38 54 82 24 43 2...

correct output
376492818

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 70

Verdict:

input
100000
2 37 51 50 50 1 14 32 15 2 22 ...

correct output
134636760

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:11:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace