a962. 新專輯
Tags : 數論 模數
Accepted rate : 49人/304人 ( 16% ) [非即時]
評分方式:
Strictly

最近更新 : 2024-04-26 15:59

Content

給定正整數 $\color{black}{N}$,請求出 $\color{black}{\left(N\operatorname{mod}1+N\operatorname{mod}2+\ldots+N\operatorname{mod}N\right)}$ 除以 $\color{black}{10^9+9}$ 的餘數。這裡 $\color{black}{a\operatorname{mod}m}$ 定義為 $\color{black}{a}$ 除以 $\color{black}{m}$ 的餘數,即唯一的非負整數 $\color{black}{r}$ 滿足 $\color{black}{r<|m|}$ 且 $\color{black}{a-r}$ 能被 $\color{black}{m}$ 整除。

Input
$\color{black}{N}$
  • $\color{black}{1\le N\le10^{14}}$。
  • $\color{black}{N}$ 為整數。
Output
$\color{black}{S}$
  • $\color{black}{S}$ 為一整數,代表 $\color{black}{\left(N\operatorname{mod}1+N\operatorname{mod}2+\ldots+N\operatorname{mod}N\right)}$ 除以 $\color{black}{10^9+9}$ 的餘數。
Sample Input #1
10
Sample Output #1
13
Sample Input #2
50
Sample Output #2
420
Sample Input #3
100000000000000
Sample Output #3
45752744
測資資訊:
記憶體限制: 512 MB
不公開 測資點#0 (5%): 1.0s , <1K
不公開 測資點#1 (5%): 1.0s , <1K
不公開 測資點#2 (5%): 1.0s , <1K
不公開 測資點#3 (5%): 1.0s , <1K
不公開 測資點#4 (5%): 1.0s , <1K
不公開 測資點#5 (5%): 1.0s , <1K
不公開 測資點#6 (5%): 1.0s , <1K
不公開 測資點#7 (5%): 1.0s , <1K
不公開 測資點#8 (5%): 1.0s , <1K
不公開 測資點#9 (5%): 1.0s , <1K
不公開 測資點#10 (5%): 1.0s , <1K
不公開 測資點#11 (5%): 1.0s , <1K
不公開 測資點#12 (5%): 1.0s , <1K
不公開 測資點#13 (5%): 1.0s , <1K
不公開 測資點#14 (5%): 1.0s , <1K
不公開 測資點#15 (5%): 1.0s , <1K
不公開 測資點#16 (5%): 1.0s , <1K
不公開 測資點#17 (5%): 1.0s , <1K
不公開 測資點#18 (5%): 1.0s , <1K
不公開 測資點#19 (5%): 1.0s , <1K
Hint :

當 $\color{black}{N = 10}$ 時,有 $\color{black}{S = 0+0+1+2+0+4+3+2+1+0 = 13}$。

Tags:
數論 模數
出處:
TIOJ1674 [管理者: xavier13540 (柊 四千) ]

Status Forum 排行

ID User Problem Subject Hit Post Date
40097 xavier13540 (柊 四千) a962
作者提供的解法
209 2024-04-26 16:55