結果

問題 No.1281 Cigarette Distribution
ユーザー hir355hir355
提出日時 2020-11-06 22:24:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 199 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 86,740 KB
実行使用メモリ 77,640 KB
最終ジャッジ日時 2023-09-29 19:03:59
合計ジャッジ時間 4,707 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,268 KB
testcase_01 AC 72 ms
71,276 KB
testcase_02 AC 72 ms
71,048 KB
testcase_03 AC 73 ms
71,332 KB
testcase_04 AC 72 ms
71,384 KB
testcase_05 AC 72 ms
71,256 KB
testcase_06 AC 72 ms
71,392 KB
testcase_07 AC 71 ms
71,280 KB
testcase_08 AC 71 ms
71,264 KB
testcase_09 AC 71 ms
71,276 KB
testcase_10 AC 73 ms
71,348 KB
testcase_11 AC 71 ms
71,264 KB
testcase_12 AC 135 ms
77,604 KB
testcase_13 AC 185 ms
77,592 KB
testcase_14 AC 168 ms
77,472 KB
testcase_15 AC 142 ms
77,464 KB
testcase_16 AC 154 ms
77,508 KB
testcase_17 AC 82 ms
75,124 KB
testcase_18 AC 196 ms
77,640 KB
testcase_19 AC 199 ms
77,392 KB
testcase_20 AC 192 ms
77,380 KB
testcase_21 AC 180 ms
77,324 KB
testcase_22 AC 191 ms
77,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
n, m = map(int, input().split())
for x in range(1, m + 1):
    if n + 1 < 2 * x:
        print(0)
    elif m == 1:
        print(n)
    else:
        t = (n + 1) // x
        p = (n + 1) % x
        print((t - 1) * pow(t + 1, p, MOD) * pow(t, x - p - 1, MOD) % MOD)
0