f979. Purple Hills
標籤 : 數學
通過比率 : 14人/17人 ( 82% ) [非即時]
評分方式:
Tolerant

最近更新 : 2021-07-12 21:18

內容

"I've been so many places, I've seen so many faces.
But nothin' compares to these blue and yellow purple hills.
I've climbed the highest mountain once or twice, but who's countin'?
But nothin' compares to these blue and yellow purple hills."

只要爬到 Purple Hill 上面,眼前就會出現好多畫面

在第 n 號的 Purple Hill 上,出現的畫面數就有 1 + 2x + 3x^2 +...+ (n+1)x^n 個

輸入說明

每行輸入正整數 x 和 n

1≤ x ≤10^6,1≤ n <2^31

輸出說明

輸出總畫面數

因為答案可能會很大,請把答案 %1000000007 後再輸出

範例輸入 #1
1 1
1 2
1 3
2 1
2 2
2 3
12345 123456
範例輸出 #1
3
6
10
5
17
49
480224489
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (20%): 1.0s , <1M
公開 測資點#1 (80%): 2.0s , <1M
提示 :

20%:1≤ n ≤100

80%:無特別限制

標籤:
數學
出處:
第四屆簡單的小競賽 [管理者: becaido (Caido) ]

本題狀況 本題討論 排行

編號 身分 題目 主題 人氣 發表日期
26090 fire5386 (becaidorz) f979
方法
483 2021-07-15 19:44