結果

問題 No.1281 Cigarette Distribution
ユーザー KudeKude
提出日時 2020-11-06 22:13:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 246 ms / 2,000 ms
コード長 244 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 77,504 KB
最終ジャッジ日時 2023-09-29 18:56:03
合計ジャッジ時間 4,609 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,344 KB
testcase_01 AC 64 ms
71,180 KB
testcase_02 AC 65 ms
71,256 KB
testcase_03 AC 64 ms
71,340 KB
testcase_04 AC 63 ms
71,232 KB
testcase_05 AC 62 ms
71,300 KB
testcase_06 AC 64 ms
71,264 KB
testcase_07 AC 60 ms
71,272 KB
testcase_08 AC 62 ms
71,268 KB
testcase_09 AC 63 ms
70,860 KB
testcase_10 AC 64 ms
71,188 KB
testcase_11 AC 63 ms
71,296 KB
testcase_12 AC 128 ms
77,152 KB
testcase_13 AC 179 ms
76,928 KB
testcase_14 AC 150 ms
77,184 KB
testcase_15 AC 124 ms
77,244 KB
testcase_16 AC 140 ms
77,176 KB
testcase_17 AC 70 ms
75,516 KB
testcase_18 AC 244 ms
77,176 KB
testcase_19 AC 246 ms
77,412 KB
testcase_20 AC 243 ms
76,880 KB
testcase_21 AC 163 ms
77,504 KB
testcase_22 AC 191 ms
77,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for x in range(1, m + 1):
    if n <= x - 1:
        print(0)
        continue
    q, r = divmod(n - (x - 1), x)
    ans = pow(q + 2, r, mod) * pow(q + 1, x - 1 - r, mod) * q % mod
    print(ans)
0