結果

問題 No.365 ジェンガソート
コンテスト
ユーザー machikox
提出日時 2019-04-24 05:24:28
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
WA  
実行時間 -
コード長 444 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,607 ms
コンパイル使用メモリ 187,216 KB
実行使用メモリ 9,920 KB
最終ジャッジ日時 2026-09-19 20:54:56
合計ジャッジ時間 5,689 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::{self, BufRead};

fn get_lines() -> Vec<String> {
    let stdin = io::stdin();
    let lines: Vec<String> = stdin.lock().lines().map(|l| l.unwrap()).collect();
    return lines;
}

fn main(){
    let s = &get_lines();
    let mut c = 1;
    for x in s[1].split(' ').map(|x| x.parse::<i32>().unwrap()) {
        if x != c {
            println!("{}", x - 1);
            return;
        }
        c += 1;
    }
    println!("0");
}
0