結果

問題 No.1281 Cigarette Distribution
ユーザー neterukunneterukun
提出日時 2020-11-06 22:26:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 276 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 77,688 KB
最終ジャッジ日時 2023-09-29 19:06:04
合計ジャッジ時間 4,979 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,268 KB
testcase_01 AC 72 ms
71,512 KB
testcase_02 AC 73 ms
71,480 KB
testcase_03 AC 71 ms
71,384 KB
testcase_04 AC 72 ms
71,416 KB
testcase_05 AC 72 ms
71,184 KB
testcase_06 AC 73 ms
71,272 KB
testcase_07 AC 71 ms
71,204 KB
testcase_08 AC 73 ms
71,276 KB
testcase_09 AC 73 ms
71,260 KB
testcase_10 AC 75 ms
71,520 KB
testcase_11 AC 71 ms
71,316 KB
testcase_12 AC 137 ms
77,144 KB
testcase_13 AC 199 ms
77,648 KB
testcase_14 AC 171 ms
77,144 KB
testcase_15 AC 145 ms
77,688 KB
testcase_16 AC 159 ms
77,536 KB
testcase_17 AC 83 ms
75,432 KB
testcase_18 AC 274 ms
77,384 KB
testcase_19 AC 276 ms
77,576 KB
testcase_20 AC 273 ms
77,388 KB
testcase_21 AC 182 ms
77,256 KB
testcase_22 AC 205 ms
77,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
MOD = 10 ** 9 + 7


for x in range(1, m + 1):
    div, mod = divmod(n + 1, x)
    r0, r1 = div - 1, div
    ans = r0 * pow(r1, x - 1 - mod, MOD) * pow(r1 + 1, x - x + mod, MOD)
    print(ans % MOD)
0