結果

問題 No.542 1円玉と5円玉
ユーザー tubo28tubo28
提出日時 2017-07-15 00:38:32
言語 Rust
(1.77.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 644 bytes
コンパイル時間 3,885 ms
コンパイル使用メモリ 170,944 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 20:55:05
合計ジャッジ時間 4,419 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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