結果

問題 No.1281 Cigarette Distribution
ユーザー nehan_der_thalnehan_der_thal
提出日時 2020-11-06 22:07:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 274 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 1,007 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 77,736 KB
最終ジャッジ日時 2023-09-29 18:49:14
合計ジャッジ時間 4,919 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,292 KB
testcase_01 AC 74 ms
71,268 KB
testcase_02 AC 72 ms
71,404 KB
testcase_03 AC 73 ms
71,200 KB
testcase_04 AC 72 ms
71,480 KB
testcase_05 AC 73 ms
71,436 KB
testcase_06 AC 72 ms
71,348 KB
testcase_07 AC 72 ms
71,152 KB
testcase_08 AC 72 ms
71,356 KB
testcase_09 AC 73 ms
71,476 KB
testcase_10 AC 71 ms
71,208 KB
testcase_11 AC 73 ms
71,240 KB
testcase_12 AC 135 ms
77,500 KB
testcase_13 AC 200 ms
77,424 KB
testcase_14 AC 169 ms
77,544 KB
testcase_15 AC 142 ms
77,488 KB
testcase_16 AC 161 ms
77,472 KB
testcase_17 AC 81 ms
75,612 KB
testcase_18 AC 271 ms
77,532 KB
testcase_19 AC 272 ms
77,576 KB
testcase_20 AC 274 ms
77,736 KB
testcase_21 AC 183 ms
77,432 KB
testcase_22 AC 204 ms
77,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
mod = 10**9+7
for i in range(1, M+1):
    d, m = divmod(N, i)
    if i-m!=1:
        R=pow(d+1, m+1, mod)*pow(d, i-m-2, mod)*(d-1)%mod
#        R = (d+1)*(d-1)*pow(d, N-2, mod)%mod
    else:
        R=pow(d+1, m, mod)*pow(d, i-m, mod)%mod
    print(R)
0