結果

問題 No.207 世界のなんとか
ユーザー ta60143ta60143
提出日時 2018-10-24 08:57:44
言語 Rust
(1.77.0)
結果
RE  
実行時間 -
コード長 787 bytes
コンパイル時間 13,554 ms
コンパイル使用メモリ 379,380 KB
実行使用メモリ 796,928 KB
最終ジャッジ日時 2024-04-29 21:17:00
合計ジャッジ時間 15,981 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 MLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io;

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    
    let mut input = input.trim().split_whitespace();
    let a: u32 = input.next().unwrap().parse().unwrap();
    let b: u32 = input.next().unwrap().parse().unwrap();

    let mut vec = vec![1u32; b as usize];

    for i in a..b {
        vec[i as usize] = i;
    }

    let iterator = 
        vec.into_iter()
        .filter(|x| x % 3 == 0 || is_including_3(*x));

    for i in iterator {
        println!("{}", i);
    }
}

fn is_including_3(num: u32) -> bool {
    let mut n = num;

    loop {
        if n % 10 == 3 {
            return true;
        }
        else if n == 0 {
            return false;
        }
        else {
            n /= 10;
        }
    }
}
0