CSES - Datatähti 2021 alku - Results
Submission details
Task:Sanalista
Sender:anton7r
Submission time:2020-10-09 20:06:45 +0300
Language:Rust
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.01 sdetails
#20.01 sdetails
#30.01 sdetails

Compiler report

warning: variable `iteraatiotStr` should have a snake case name
 --> input/code.rs:6:13
  |
6 |     let mut iteraatiotStr = String::new();
  |             ^^^^^^^^^^^^^ help: convert the identifier to snake case: `iteraatiot_str`
  |
  = note: `#[warn(non_snake_case)]` on by default

warning: unused `std::result::Result` that must be used
 --> input/code.rs:7:5
  |
7 |     io::stdin().read_line(&mut iteraatiotStr);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_must_use)]` on by default
  = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `std::result::Result` that must be used
  --> input/code.rs:13:9
   |
13 |         io::stdin().read_line(&mut syote);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this `Result` may be an `Err` variant, which should be handled

Code

use std::io;

fn main() {
    let mut parilliset : i16 = 0;

    let mut iteraatiotStr = String::new();
    io::stdin().read_line(&mut iteraatiotStr);

    let iteraatiot = iteraatiotStr.parse::<i16>().unwrap();

    for _ in 0 .. iteraatiot {
        let mut syote = String::new();
        io::stdin().read_line(&mut syote);

        if syote.chars().count() % 2 == 0 {
            parilliset+=1;
        }
    }

    print!("{}", parilliset)
}

Test details

Test 1

Verdict:

input
1000
korvata
sopimusaika
nuhatartunta
korttiautomaatti
...

correct output
15

user output
(empty)

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

Test 2

Verdict:

input
1000
pub
hansikaslokero
erikoisvalmisteinen
unijukka
...

correct output
42

user output
(empty)

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

Test 3

Verdict:

input
1000
haapalastu
toipumisaika
mustalaiskieli
taidelainaamo
...

correct output
70

user output
(empty)

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