結果
| 問題 | No.3388 Sum of Function |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-13 13:40:12 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 288 bytes |
| 記録 | |
| コンパイル時間 | 10,200 ms |
| コンパイル使用メモリ | 400,436 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-12-13 13:40:26 |
| 合計ジャッジ時間 | 11,683 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
use proconio::input;
fn is_prime(n: usize) -> bool {
n >= 2 && (2..n).all(|i| n % i != 0)
}
fn main() {
input! {
a: usize,
b: usize,
}
let ans: usize = (a..=b)
.filter(|x| is_prime(*x))
.map(|x| x*x*x - x*x + x + 1)
.sum();
println!("{ans}");
}