Submission #31266057


Source Code Expand

use proconio::input;

fn main() {
    input! {
        a: [[usize; 3]; 3],
        n: usize,
        b: [usize; n],
    };
    let mut c = vec![vec![false; 3]; 3];
    for b_i in b {
        for i in 0..3 {
            for j in 0..3 {
                if a[i][j] == b_i {
                    c[i][j] = true;
                }
            }
        }
    }
    for i in 0..3 {
        let mut ok = true;
        for j in 0..3 {
            if !c[i][j] {
                ok = false;
            }
        }
        if ok {
            println!("Yes");
            return;
        }
    }
    for j in 0..3 {
        let mut ok = true;
        for i in 0..3 {
            if !c[i][j] {
                ok = false;
            }
        }
        if ok {
            println!("Yes");
            return;
        }
    }
    let mut ok = true;
    for i in 0..3 {
        if !c[i][i] {
            ok = false;
        }
    }
    if ok {
        println!("Yes");
        return;
    }
    let mut ok = true;
    for i in 0..3 {
        if !c[i][3 - 1 - i] {
            ok = false;
        }
    }
    if ok {
        println!("Yes");
        return;
    }

    println!("No");
}

Submission Info

Submission Time
Task B - Bingo
User bouzuya
Language Rust (1.42.0)
Score 200
Code Size 1174 Byte
Status AC
Exec Time 2 ms
Memory 2184 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 16
Set Name Test Cases
Sample 00-sample-0, 00-sample-281, 00-sample-511
All 00-sample-0, 00-sample-281, 00-sample-511, 01-random-134, 01-random-238, 01-random-292, 01-random-297, 01-random-314, 01-random-329, 01-random-352, 01-random-387, 01-random-392, 01-random-420, 01-random-462, 01-random-500, 01-random-86
Case Name Status Exec Time Memory
00-sample-0 AC 1 ms 2140 KiB
00-sample-281 AC 1 ms 2116 KiB
00-sample-511 AC 2 ms 1992 KiB
01-random-134 AC 1 ms 1996 KiB
01-random-238 AC 2 ms 2068 KiB
01-random-292 AC 2 ms 2016 KiB
01-random-297 AC 2 ms 2100 KiB
01-random-314 AC 1 ms 1960 KiB
01-random-329 AC 2 ms 2184 KiB
01-random-352 AC 2 ms 1992 KiB
01-random-387 AC 1 ms 2008 KiB
01-random-392 AC 2 ms 2088 KiB
01-random-420 AC 1 ms 1976 KiB
01-random-462 AC 1 ms 2064 KiB
01-random-500 AC 2 ms 2076 KiB
01-random-86 AC 2 ms 2112 KiB