結果

問題 No.677 10^Nの約数
ユーザー nekoziroo
提出日時 2018-05-26 17:50:24
言語 Rust
(1.83.0 + proconio)
結果
RE  
実行時間 -
コード長 558 bytes
コンパイル時間 13,251 ms
コンパイル使用メモリ 378,704 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 18:14:54
合計ジャッジ時間 14,278 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::f32;
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.split_whitespace().collect();

    let a: i16 = line[0].parse().unwrap();
    let b: i16 = line[1].parse().unwrap();

    let mut result = 0;
    for i in a..b + 1 {
        let sum = a + b + i;
        let average = sum as f32 / 3.0;
        if average.fract() == 0.0 {
            result += 1;
        }
    }
    println!("{}", result);
}
0