結果

問題 No.1281 Cigarette Distribution
ユーザー titiatitia
提出日時 2020-11-06 21:58:31
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 500 ms / 2,000 ms
コード長 196 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 8,292 KB
最終ジャッジ日時 2023-09-29 18:42:28
合計ジャッジ時間 5,750 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,820 KB
testcase_01 AC 15 ms
7,752 KB
testcase_02 AC 14 ms
7,776 KB
testcase_03 AC 15 ms
7,720 KB
testcase_04 AC 14 ms
7,776 KB
testcase_05 AC 14 ms
7,808 KB
testcase_06 AC 14 ms
7,756 KB
testcase_07 AC 15 ms
7,788 KB
testcase_08 AC 14 ms
7,912 KB
testcase_09 AC 14 ms
7,792 KB
testcase_10 AC 15 ms
7,856 KB
testcase_11 AC 15 ms
7,776 KB
testcase_12 AC 216 ms
7,760 KB
testcase_13 AC 406 ms
8,184 KB
testcase_14 AC 377 ms
7,808 KB
testcase_15 AC 206 ms
8,292 KB
testcase_16 AC 270 ms
8,216 KB
testcase_17 AC 18 ms
7,860 KB
testcase_18 AC 494 ms
8,212 KB
testcase_19 AC 495 ms
8,180 KB
testcase_20 AC 500 ms
8,212 KB
testcase_21 AC 435 ms
7,780 KB
testcase_22 AC 450 ms
8,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for i in range(1,M+1):
    if (i-1)*2>=N:
        print(0)
        continue
    r,q=divmod((N-(i-1)),i)
    print(pow(r+2,q,mod)*pow(r+1,i-1-q,mod)*r%mod)
0