CSES - Aalto Competitive Programming 2024 - wk1 - Wed - Results
Submission details
Task:Scorpion and frogs
Sender:aalto2024a_005
Submission time:2024-09-04 16:57:31 +0300
Language:Rust
Status:COMPILE ERROR

Compiler report

error[E0583]: file not found for module `classes`
 --> input/code.rs:7:1
  |
7 | mod classes;
  | ^^^^^^^^^^^^
  |
  = help: to create the module `classes`, create file "input/classes.rs" or "input/classes/mod.rs"

error: aborting due to previous error

For more information about this error, try `rustc --explain E0583`.

Code

use std::io::{self, Read};

macro_rules! input {
    ($it: expr) => ($it.next().unwrap().parse().unwrap());
    ($it: expr, $T: ty) => ($it.next().unwrap().parse::<$T>().unwrap());
}
mod classes;

fn main() {
    // println!("{}", "-".repeat(20));
    // classes::c02::taskC();
    // println!("{}", "-".repeat(20));

    task();
}

#[allow(dead_code)]
fn task(){
    let mut buf = String::new();
    io::stdin().read_to_string(&mut buf).unwrap();

    let mut it = buf.split_whitespace();

    let n: usize = input!(it);
    let mut v: Vec<u128> = vec![0; n+1];
    v[0] = 1;
    v[1] = 2;
    for i in 2..=n {
        v[i] = (v[i-1] + v[i-2]) % 998244353;
    }

    println!("{}", v[n]);
}