CSES - Aalto Competitive Programming 2024 - wk1 - Mon - Results
Submission details
Task:Backpacking
Sender:odanobunaga8199
Submission time:2024-09-02 17:09:33 +0300
Language:Rust
Status:READY
Result:
Test results
testverdicttime
#10.00 sdetails
#20.00 sdetails
#30.00 sdetails
#40.00 sdetails

Compiler report

warning: unused `Result` that must be used
 --> input/code.rs:5:5
  |
5 |     io::stdin().read_line(&mut input1);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this `Result` may be an `Err` variant, which should be handled
  = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
  |
5 |     let _ = io::stdin().read_line(&mut input1);
  |     +++++++

warning: unused `Result` that must be used
 --> input/code.rs:8:5
  |
8 |     io::stdin().read_line(&mut input2);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
  |
8 |     let _ = io::stdin().read_line(&mut input2);
  |     +++++++

warning: 2 warnings emitted

Code

use std::io;

fn main() {
    let mut input1 = String::new();
    io::stdin().read_line(&mut input1);
    let num1: i32 = input1.trim().parse().unwrap();
    let mut input2 = String::new();
    io::stdin().read_line(&mut input2);
    let num2: i32 = input2.trim().parse().unwrap();
    println!("{}", num1 + num2);
}

Test details

Test 1

Verdict:

input
3 5

correct output
8

user output
(empty)

Error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', input/code.rs:6:43
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 2

Verdict:

input
571335 750047

correct output
1321382

user output
(empty)

Error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', input/code.rs:6:43
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 3

Verdict:

input
744471 719178

correct output
1463649

user output
(empty)

Error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', input/code.rs:6:43
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 4

Verdict:

input
308833 436123

correct output
744956

user output
(empty)

Error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', input/code.rs:6:43
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace