結果

問題 No.1281 Cigarette Distribution
ユーザー trineutrontrineutron
提出日時 2020-11-21 16:57:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 235 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 79,780 KB
最終ジャッジ日時 2023-09-30 22:06:26
合計ジャッジ時間 5,171 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,164 KB
testcase_01 AC 73 ms
71,276 KB
testcase_02 AC 73 ms
71,356 KB
testcase_03 AC 77 ms
71,232 KB
testcase_04 AC 74 ms
71,232 KB
testcase_05 AC 73 ms
71,244 KB
testcase_06 AC 74 ms
71,508 KB
testcase_07 AC 73 ms
71,388 KB
testcase_08 AC 74 ms
71,316 KB
testcase_09 AC 71 ms
71,276 KB
testcase_10 AC 72 ms
71,148 KB
testcase_11 AC 72 ms
71,356 KB
testcase_12 AC 147 ms
77,728 KB
testcase_13 AC 189 ms
78,860 KB
testcase_14 AC 168 ms
77,668 KB
testcase_15 AC 149 ms
77,748 KB
testcase_16 AC 163 ms
78,260 KB
testcase_17 AC 86 ms
75,752 KB
testcase_18 AC 232 ms
79,780 KB
testcase_19 AC 235 ms
79,620 KB
testcase_20 AC 231 ms
79,556 KB
testcase_21 AC 178 ms
78,420 KB
testcase_22 AC 188 ms
77,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9 + 7

def power(n, k):
    if k == 0:
        return 1
    res = 1
    while k:
        if k % 2:
            res = res * n % mod
        n = n * n % mod
        k //= 2
    return res

n, m = map(int, input().split())
for i in range(1, m + 1):
    d, r = divmod(n + 1, i)
    print(power(d+1, r) * power(d, i-r-1) * (d-1) % mod)
0