結果

問題 No.1281 Cigarette Distribution
ユーザー irumo8202irumo8202
提出日時 2022-02-06 18:04:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 271 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 84,760 KB
最終ジャッジ日時 2023-09-02 07:03:53
合計ジャッジ時間 4,921 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,292 KB
testcase_01 AC 71 ms
71,160 KB
testcase_02 AC 71 ms
71,216 KB
testcase_03 AC 70 ms
71,148 KB
testcase_04 AC 70 ms
71,516 KB
testcase_05 AC 72 ms
71,116 KB
testcase_06 AC 71 ms
71,292 KB
testcase_07 AC 71 ms
71,248 KB
testcase_08 AC 71 ms
71,396 KB
testcase_09 AC 70 ms
71,508 KB
testcase_10 AC 70 ms
71,264 KB
testcase_11 AC 71 ms
71,472 KB
testcase_12 AC 128 ms
79,672 KB
testcase_13 AC 193 ms
81,996 KB
testcase_14 AC 163 ms
81,024 KB
testcase_15 AC 138 ms
79,432 KB
testcase_16 AC 154 ms
80,084 KB
testcase_17 AC 81 ms
76,244 KB
testcase_18 AC 269 ms
84,624 KB
testcase_19 AC 271 ms
84,504 KB
testcase_20 AC 270 ms
84,760 KB
testcase_21 AC 177 ms
81,580 KB
testcase_22 AC 198 ms
82,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
MOD = 10 ** 9 + 7
ans = [0] * M

for i in range(1, M + 1):
    q, r = (N + 1) // i, (N + 1) % i
    ans[i - 1] = (q - 1) * pow(q, i - r - 1, MOD) * pow(q + 1, r, MOD) % MOD

print(*ans, sep="\n")
0