結果

問題 No.1183 コイン遊び
ユーザー ynpppynppp
提出日時 2023-11-21 09:45:42
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 2,026 bytes
コンパイル時間 1,057 ms
コンパイル使用メモリ 187,288 KB
実行使用メモリ 10,692 KB
最終ジャッジ日時 2023-11-21 09:45:52
合計ジャッジ時間 8,536 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 WA -
testcase_04 AC 1 ms
6,676 KB
testcase_05 AC 1 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 4 ms
6,676 KB
testcase_11 AC 10 ms
6,676 KB
testcase_12 AC 95 ms
7,296 KB
testcase_13 AC 85 ms
6,784 KB
testcase_14 AC 140 ms
10,052 KB
testcase_15 WA -
testcase_16 AC 150 ms
10,692 KB
testcase_17 WA -
testcase_18 AC 149 ms
10,692 KB
testcase_19 WA -
testcase_20 AC 149 ms
10,692 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 159 ms
10,692 KB
testcase_24 WA -
testcase_25 AC 149 ms
10,692 KB
testcase_26 AC 150 ms
10,692 KB
testcase_27 AC 149 ms
10,692 KB
testcase_28 AC 149 ms
10,692 KB
testcase_29 WA -
testcase_30 AC 146 ms
10,692 KB
testcase_31 AC 149 ms
10,692 KB
testcase_32 WA -
testcase_33 AC 149 ms
10,692 KB
testcase_34 AC 150 ms
10,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#![allow(dead_code, unused_variables, unused_macros, unused_imports)]

fn main() {
    input!(n:usize, a:[i32;n],b:[i32;n]);

    let mut v: Vec<_> = a.into_iter().zip(b).map(|(ai, bi)| ai == bi).collect();
    v.dedup();
    println!("{}", (v.len() + 1) / 2);
}

mod xxx {
    // https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
    #[macro_export]
    macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        input_inner!{$s, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
    #[macro_export]
    macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

    #[macro_export]
    macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, bits)=>{
        u64::from_str_radix(&$next(), 2).expect("Parse error")
    };

    ($next:expr, hexs)=>{
        u64::from_str_radix(&$next(), 16).expect("Parse error")
    };


    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
}
0