CSES - Datatähti 2023 alku - Results
Submission details
Task:Kortit
Sender:ToukoP
Submission time:2022-11-08 22:21:17 +0200
Language:Rust
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1--details
#2--details
#3--details
#4--details
#5--details
#6--details

Code

/*
fn read_line() -> String {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line
}
*/

fn read_num() -> Option<i32> {
    let mut line = String::new();
    match std::io::stdin().read_line(&mut line) {
        Ok(_) => {
            let int = line.trim().parse::<i32>();
            int.ok()
        },
        Err(_) => {
            None
        }
    }
}

fn run() {
    let count = 52;
    let colors = 2;
    if let Some(n) = read_num() {
        if n > count / colors {
            return println!("YES")
        }
        
        if n <= colors {
            return println!("NO")
        }
        
        println!("MAYBE");
    }
}

fn main() {
    loop { run() }
}

Test details

Test 1

Verdict:

input
0

correct output
NO

user output
(empty)

Test 2

Verdict:

input
1

correct output
NO

user output
(empty)

Test 3

Verdict:

input
2

correct output
MAYBE

user output
(empty)

Test 4

Verdict:

input
26

correct output
MAYBE

user output
(empty)

Test 5

Verdict:

input
27

correct output
YES

user output
(empty)

Test 6

Verdict:

input
52

correct output
YES

user output
(empty)