結果

問題 No.1714 Tag on Grid
ユーザー Masaki KitaguchiMasaki Kitaguchi
提出日時 2022-02-05 20:30:44
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 2,236 bytes
コンパイル時間 6,881 ms
コンパイル使用メモリ 125,052 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-02 06:51:50
合計ジャッジ時間 2,463 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 1 ms
4,380 KB
testcase_19 WA -
testcase_20 AC 1 ms
4,380 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#[macro_export]
macro_rules! setup {
    { mut $input:ident: SplitWhitespace $(,)? } => {
        use std::io::Read;
        let mut buf = String::new();
        std::io::stdin().read_to_string(&mut buf).ok();
        let mut $input = buf.split_whitespace();
    };
}

#[macro_export]
macro_rules! parse_next {
    ($str_iter:expr) => {
        $str_iter.next().unwrap().parse().ok().unwrap()
    };
}

#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, VecDeque};

fn main() {
    setup! { mut input: SplitWhitespace };

    let h: usize = parse_next!(input);
    let w: usize = parse_next!(input);
    let n: (usize, usize) = (parse_next!(input), parse_next!(input));
    let z: (usize, usize) = (parse_next!(input), parse_next!(input));

    let ans = match (|| {
        if z == (1, 1) {
            if n == (1, 2) {
                return true;
            }
            if n == (3, 2) {
                return true;
            }
            if n == (2, 1) {
                return true;
            }
            if n == (2, 3) {
                return true;
            }
        }
        if z == (1, w) {
            if n == (1, w - 1) {
                return true;
            }
            if n == (3, w - 1) {
                return true;
            }
            if n == (2, w - 2) {
                return true;
            }
            if n == (2, w) {
                return true;
            }
        }
        if z == (h, 1) {
            if n == (h - 2, 2) {
                return true;
            }
            if n == (h, 2) {
                return true;
            }
            if n == (h - 1, 1) {
                return true;
            }
            if n == (h - 1, 3) {
                return true;
            }
        }
        if z == (h, w) {
            if n == (h - 2, w - 1) {
                return true;
            }
            if n == (h, w - 1) {
                return true;
            }
            if n == (h - 1, w - 2) {
                return true;
            }
            if n == (h - 1, w) {
                return true;
            }
        }
        return false;
    })() {
        true => "Yes",
        false => "No",
    };

    println!("{}", ans);
}
0