結果
| 問題 | No.3388 Sum of Function |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-20 18:20:47 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 559 bytes |
| コンパイル時間 | 21,361 ms |
| コンパイル使用メモリ | 401,040 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-11-28 20:55:15 |
| 合計ジャッジ時間 | 13,635 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
#![allow(unused)]
#![allow(non_snake_case)]
#![allow(dead_code)]
fn main() {
let input_str = std::io::read_to_string(std::io::stdin()).unwrap();
let mut input = input_str.split_whitespace();
let mut read_int = ||->usize {input.next().unwrap().parse().unwrap()};
let (A,B)=(read_int(),read_int());
let primes = vec![2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97];
let mut ans = 0;
for &p in primes.iter(){
if A <= p && p <= B{
ans += (p*p*p-p*p+p+1);
}
}
println!("{}",ans);
}