結果

問題 No.3388 Sum of Function
コンテスト
ユーザー あるふぁ
提出日時 2026-08-27 12:30:08
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
WA  
実行時間 -
コード長 399 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,188 ms
コンパイル使用メモリ 179,956 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-27 12:30:17
合計ジャッジ時間 7,948 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use proconio::input;

fn f(x: i32) -> i32{
    x*x*x-x*x+x+1
}

fn main(){
    input!{
        a: usize,
        b: usize,
    }

    let mut ans: i32 = 0;
    for n in a..=b{
        let mut ok: bool = true;
        for m in 2..n{
            if n%m == 0{
                ok = false;
            }
        }
        if ok{
            ans += f(n as i32);
        }
    }
    println!("{}", ans);
}
0