結果

問題 No.207 世界のなんとか
ユーザー nekoziroo
提出日時 2018-05-28 15:00:50
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 801 bytes
コンパイル時間 12,279 ms
コンパイル使用メモリ 402,316 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 07:46:07
合計ジャッジ時間 13,067 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused import: `std::i32`
 --> src/main.rs:1:5
  |
1 | use std::i32;
  |     ^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

ソースコード

diff #

use std::i32;
use std::io::stdin;

fn get_line() -> String {
    let mut line = String::new();
    stdin().read_line(&mut line).ok();
    line
}

fn main() {
    let line = get_line();
    let line: Vec<&str> = line.trim().split_whitespace().collect();
    let line: Vec<i64> = line.iter().map(|x| x.parse().unwrap()).collect();

    let a = line[0];
    let b = line[1];

    let mut results: Vec<i64> = Vec::new();

    for i in a..b + 1 {
        if i % 3 == 0 {
            results.push(i);
        } else {
            let str = i.to_string();
            let str = str.as_str();
            for j in str.chars() {
                if j == '3' {
                    results.push(i);
                }
            }
        }
    }

    for i in results.iter() {
        println!("{}", i);
    }
}
0