Submission #2110008


Source Code Expand

Copy
fn get_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().to_string()
}

fn reads<T>() -> Vec<T>
    where
        T: std::str::FromStr,
        <T as std::str::FromStr>::Err: std::fmt::Debug {
    get_line().split(' ').map(|x| x.parse().unwrap()).collect()
}

fn main() {
    let mut cs = vec![];

    for _ in 0..3 {
        let xs: Vec<i64> = reads();
        cs.push(xs);
    }

    let mut res = true;
    'outer:
    for i in 0..3 {
        for j in 0..3 {
            let v0 = cs[i][0] - cs[j][0];
            let v1 = cs[i][1] - cs[j][1];
            let v2 = cs[i][2] - cs[j][2];

            let u0 = cs[0][i] - cs[0][j];
            let u1 = cs[1][i] - cs[1][j];
            let u2 = cs[2][i] - cs[2][j];

            if !(v0 == v1 && v1 == v2 && v2 == v0 && u0 == u1 && u1 == u2 && u2 == u0) {
                res = false;
                break 'outer;
            }
        }
    }

    println!("{}",
    if res {
        "Yes"
    }
    else {
        "No"
    });
}

Submission Info

Submission Time
Task C - Takahashi's Information
User lodnix
Language Rust (1.15.1)
Score 300
Code Size 1085 Byte
Status
Exec Time 2 ms
Memory 4352 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt
All 300 / 300 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, in18.txt, in19.txt, in20.txt, sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt
Case Name Status Exec Time Memory
in01.txt 2 ms 4352 KB
in02.txt 2 ms 4352 KB
in03.txt 2 ms 4352 KB
in04.txt 2 ms 4352 KB
in05.txt 2 ms 4352 KB
in06.txt 2 ms 4352 KB
in07.txt 2 ms 4352 KB
in08.txt 2 ms 4352 KB
in09.txt 2 ms 4352 KB
in10.txt 2 ms 4352 KB
in11.txt 2 ms 4352 KB
in12.txt 2 ms 4352 KB
in13.txt 2 ms 4352 KB
in14.txt 2 ms 4352 KB
in15.txt 2 ms 4352 KB
in16.txt 2 ms 4352 KB
in17.txt 2 ms 4352 KB
in18.txt 2 ms 4352 KB
in19.txt 2 ms 4352 KB
in20.txt 2 ms 4352 KB
sample_1.txt 2 ms 4352 KB
sample_2.txt 2 ms 4352 KB
sample_3.txt 2 ms 4352 KB
sample_4.txt 2 ms 4352 KB