結果

問題 No.446 ゆきこーだーの雨と雪 (1)
コンテスト
ユーザー hebiyan
提出日時 2017-05-22 16:58:39
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
WA  
実行時間 -
コード長 542 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 684 ms
コンパイル使用メモリ 188,424 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-07 20:19:51
合計ジャッジ時間 1,769 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 8 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

fn getline() -> String {
    let mut s = String::new();

    std::io::stdin().read_line(&mut s).ok();

    s
}

fn judge(s: &mut String) -> bool {
    let vs: String = s.matches(char::is_numeric).collect();
    
    *s == vs
        && s.chars().nth(0).unwrap()!= '0'
        && (s.parse::<u64>().unwrap() <= 12345)
}

fn main() {
    let s = getline();

    let result:bool = s.trim().lines()
        .fold(true, |acc, ss| acc && judge(&mut ss.to_string()));

    println!("{}", if result {
        "OK"
    } else {
        "NG"
    });
}
0