Submission #8571249


Source Code Expand

Copy
use std::io::*;
use std::str::FromStr;

fn main() {
    let x: usize = read();
    let y: usize = read();

    let mut sum = 0;
    if x == 3 {
        sum += 100000;
    } else if x == 2 {
        sum += 200000;
    } else if x == 1 {
        sum += 300000;
    }
    if y == 3 {
        sum += 100000;
    } else if y == 2 {
        sum += 200000;
    } else if y == 1 {
        sum += 300000;
    }
    if x == 1 && y == 1 {
        sum += 400000;
    }
    println!("{}", sum);
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

Submission Info

Submission Time
Task A - DDCC Finals
User mds_boy
Language Rust (1.15.1)
Score 100
Code Size 833 Byte
Status AC
Exec Time 2 ms
Memory 4352 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 20
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
in01.txt AC 2 ms 4352 KB
in02.txt AC 2 ms 4352 KB
in03.txt AC 2 ms 4352 KB
in04.txt AC 2 ms 4352 KB
in05.txt AC 2 ms 4352 KB
in06.txt AC 2 ms 4352 KB
in07.txt AC 2 ms 4352 KB
in08.txt AC 2 ms 4352 KB
in09.txt AC 2 ms 4352 KB
in10.txt AC 2 ms 4352 KB
in11.txt AC 2 ms 4352 KB
in12.txt AC 2 ms 4352 KB
in13.txt AC 2 ms 4352 KB
in14.txt AC 2 ms 4352 KB
in15.txt AC 2 ms 4352 KB
in16.txt AC 2 ms 4352 KB
in17.txt AC 2 ms 4352 KB
sample_01.txt AC 2 ms 4352 KB
sample_02.txt AC 2 ms 4352 KB
sample_03.txt AC 2 ms 4352 KB