結果

問題 No.3100 始業式
ユーザー so-heyso-hey
提出日時 2023-05-28 13:15:24
言語 Rust
(1.77.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 1,163 bytes
コンパイル時間 581 ms
コンパイル使用メモリ 142,856 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-27 07:40:17
合計ジャッジ時間 1,197 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#![allow(dead_code)]

fn input_num() -> usize {
    let mut line: String = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.trim().parse().unwrap()
}

fn input_chars() -> Vec<char> {
    let mut line: String = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.trim().chars().collect()
}

fn input_nums() -> (usize, f64, f64) {
    let mut line: String = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    let mut iter = line.split_whitespace();
    (
        iter.next().unwrap().parse().unwrap(),
        iter.next().unwrap().parse().unwrap(),
        iter.next().unwrap().parse().unwrap()
    )
}

fn input_vec_nums() -> Vec<usize> {
    let mut line: String = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect()
}

fn main() {
    let t = input_num();
    for _ in 0..t {
        let n = input_num();
        let f = input_vec_nums();
        let mut ans = 0;
        for i in 0..n {
            if f[i] == 1 { ans += 1 }
        }
        println!("{}", (n - ans + 1) % (n + 1));
    }
}
0