結果

問題 No.2535 多重同値
ユーザー VvyLwVvyLw
提出日時 2023-11-11 04:20:19
言語 Rust
(1.77.0)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 2,012 bytes
コンパイル時間 565 ms
コンパイル使用メモリ 174,400 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-11-11 04:20:21
合計ジャッジ時間 1,908 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 AC 1 ms
6,676 KB
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 AC 1 ms
6,676 KB
testcase_08 AC 1 ms
6,676 KB
testcase_09 AC 1 ms
6,676 KB
testcase_10 AC 1 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 1 ms
6,676 KB
testcase_13 AC 1 ms
6,676 KB
testcase_14 AC 1 ms
6,676 KB
testcase_15 AC 3 ms
6,676 KB
testcase_16 AC 15 ms
6,676 KB
testcase_17 AC 141 ms
6,676 KB
testcase_18 AC 142 ms
6,676 KB
testcase_19 AC 143 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// source: https://github.com/mio-dokuhaki/Collatz/blob/main/src/main.rs
#[allow(unused_macros)]
// 整数1つ読み込み(macro)
macro_rules! read {
    ($($t:ty),*) => {
        {
            let mut input = String::new();
            std::io::stdin().read_line(&mut input).ok();
            let mut iter = input.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap()),*)
        }
    };
}
#[allow(unused_macros)]
// 文字列1つ読み込み(macro)
macro_rules! read_str {
    () => {
        {
            let mut input = String::new();
            std::io::stdin().read_line(&mut input).ok();
            input.trim().to_string()
        }
    };
}

#[allow(unused_macros)]
// 整数の1次元ベクトル読み込み(macro)
macro_rules! read_vec {
    ($t:ty) => {
        {
            let mut input = String::new();
            std::io::stdin().read_line(&mut input).ok();
            input.trim().split_whitespace().map(|x| x.parse::<$t>().unwrap()).collect::<Vec<$t>>()
        }
    };
}

#[allow(unused_macros)]
// 文字列の1次元ベクトル読み込み(macro)
macro_rules! read_str_vec {
    () => {
        {
            let mut input = String::new();
            std::io::stdin().read_line(&mut input).ok();
            input.trim().split_whitespace().map(|x| x.to_string()).collect::<Vec<String>>()
        }
    };
}

#[allow(unused_macros)]
// 2次元ベクトル読み込み(macro)
macro_rules! read_2d_vec {
    ($t:ty, $rows:expr, $cols:expr) => {
        {
            let mut vec_2d: Vec<Vec<$t>> = Vec::with_capacity($rows);
            for _ in 0..$rows {
                vec_2d.push(read_vec!($t; $cols));
            }
            vec_2d
        }
    };
}

use std::io::Write;

pub fn main() {
    std::io::stdout().flush().ok();
    let n = read!(i32);
    let mut ok = true;
    for _ in 0..n {
        let s = read_str!();
        ok ^= s == "No";
        println!("{}", match ok{
        	true => "Yes",
        	_ => "No",
        })
    }
}
0