結果

問題 No.542 1円玉と5円玉
コンテスト
ユーザー tubo28
提出日時 2017-07-15 00:38:32
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 2,000 ms
+ 352µs
コード長 644 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 8,747 ms
コンパイル使用メモリ 184,808 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-11 18:38:04
合計ジャッジ時間 10,042 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::*;
use std::collections::*;

fn get<T: std::str::FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let s: String = stdin.bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    s.parse().unwrap_or_else(|_| panic!())
}

fn main() {
    let a: u32 = get();
    let b: u32 = get();
    let mut s = BTreeSet::new();
    for i in 0..a+1 {
        for j in 0..b+1 {
            if i + j > 0 {
                s.insert(i + j*5);
            }
        }
    }
    for x in s {
        println!("{}", x);
    }
}
0