結果

問題 No.2092 Conjugation
ユーザー phsplsphspls
提出日時 2022-10-09 18:55:48
言語 Rust
(1.77.0)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 557 bytes
コンパイル時間 1,878 ms
コンパイル使用メモリ 147,644 KB
実行使用メモリ 10,216 KB
最終ジャッジ日時 2023-09-05 22:18:38
合計ジャッジ時間 4,109 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 13 ms
8,268 KB
testcase_08 AC 17 ms
9,648 KB
testcase_09 AC 15 ms
8,968 KB
testcase_10 AC 16 ms
9,232 KB
testcase_11 AC 14 ms
9,160 KB
testcase_12 AC 15 ms
8,952 KB
testcase_13 AC 14 ms
8,632 KB
testcase_14 AC 14 ms
8,724 KB
testcase_15 AC 15 ms
8,904 KB
testcase_16 AC 18 ms
9,960 KB
testcase_17 AC 19 ms
10,216 KB
testcase_18 AC 19 ms
10,108 KB
testcase_19 AC 4 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).ok();
    let n: usize = n.trim().parse().unwrap();
    let mut a = String::new();
    std::io::stdin().read_line(&mut a).ok();
    let a: Vec<usize> = a.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();

    let mut dp = vec![0isize; 100001];
    for i in 0..n {
        dp[0] += 1;
        dp[a[i]] -= 1;
    }
    for i in 0..100000 {
        dp[i+1] += dp[i];
    }
    println!("{}", (0..a[0]).map(|i| dp[i].to_string()).collect::<Vec<_>>().join(" "));
}
0