結果

問題 No.365 ジェンガソート
ユーザー cra77756176
提出日時 2022-12-09 01:10:50
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 12,433 ms
コンパイル使用メモリ 379,564 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-14 18:23:18
合計ジャッジ時間 14,580 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut aa = String::new();
    std::io::Read::read_to_string(&mut std::io::stdin(), &mut aa).ok();
    let aa: Vec<u64> = aa.split_whitespace().skip(1).flat_map(str::parse).collect();

    let n = aa.len() as u64;
    let mut seq = 0;

    for &a in aa.iter().rev() {
        if a == n - seq {
            seq += 1;
        }
    }

    println!("{}", n - seq);
}
0