Type: Default 1000ms 512MiB

[R46B]质数和

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

时空限制

1S/512M

题目描述

给定两个正整数 LLRR,请你求出 LLRR 内的质数的和。

格式

输入格式

输入一行,包含两个正整数 LLRR,之间用一个空格隔开。

输出格式

输出一个整数,表示区间 [L,R][L, R] 内所有质数的和。

样例

样例输入 #1

15 23

样例输出 #1

59

样例解释 #1

在区间 [15,23][15, 23] 中,质数有 1717, 1919, 2323。 和为:17+19+23=5917 + 19 + 23 = 59

数据规模

对于 100%100\% 的数据,1LR1071 \le L \le R \le 10^7RL+1104R - L + 1 \le 10^4

代码源挑战赛 Round 46

Not Attended
Status
Done
Rule
DMY
Start at
2026-1-16 20:00
End at
2026-1-16 21:30
Duration
1.5 hour(s)
Host
Partic.
388