結果
| 問題 | No.3388 Sum of Function |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-09 22:06:48 |
| 言語 | Rust (1.92.0 + proconio + num) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 502 bytes |
| 記録 | |
| コンパイル時間 | 23,972 ms |
| コンパイル使用メモリ | 418,104 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-01-09 22:07:47 |
| 合計ジャッジ時間 | 25,145 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
use proconio::input;
fn main() {
input! {
a: usize,
b: usize,
}
let mut prime = vec![];
for i in 2..100 {
let mut f = true;
for j in 2..i {
if i % j == 0 {
f = false;
break;
}
}
if f {
prime.push(i);
}
}
let mut res = 0;
for x in prime {
if a <= x && x <= b {
res += x*x*x - x*x + x + 1;
}
}
println!("{}", res);
}