結果

問題 No.1281 Cigarette Distribution
ユーザー H3PO4H3PO4
提出日時 2022-02-16 09:24:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 789 ms / 2,000 ms
コード長 200 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 10,508 KB
実行使用メモリ 8,280 KB
最終ジャッジ日時 2023-09-11 17:07:29
合計ジャッジ時間 7,646 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,796 KB
testcase_01 AC 16 ms
7,744 KB
testcase_02 AC 16 ms
7,772 KB
testcase_03 AC 15 ms
7,800 KB
testcase_04 AC 16 ms
7,828 KB
testcase_05 AC 15 ms
7,720 KB
testcase_06 AC 16 ms
7,788 KB
testcase_07 AC 16 ms
7,728 KB
testcase_08 AC 16 ms
7,848 KB
testcase_09 AC 16 ms
7,796 KB
testcase_10 AC 16 ms
7,840 KB
testcase_11 AC 16 ms
7,836 KB
testcase_12 AC 215 ms
7,800 KB
testcase_13 AC 492 ms
8,236 KB
testcase_14 AC 373 ms
7,840 KB
testcase_15 AC 245 ms
8,280 KB
testcase_16 AC 308 ms
8,276 KB
testcase_17 AC 19 ms
7,720 KB
testcase_18 AC 789 ms
8,276 KB
testcase_19 AC 779 ms
8,256 KB
testcase_20 AC 777 ms
8,156 KB
testcase_21 AC 436 ms
7,840 KB
testcase_22 AC 512 ms
8,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for x in range(1, M + 1):
    d, m = divmod(N + 1, x)
    ans = pow(d + 1, m, MOD) * pow(d, x - m - 1, MOD) * (d - 1)
    ans %= MOD
    print(ans)
0