結果

問題 No.1281 Cigarette Distribution
ユーザー AEnAEn
提出日時 2022-05-27 16:35:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 81,860 KB
実行使用メモリ 75,708 KB
最終ジャッジ日時 2023-10-20 19:45:37
合計ジャッジ時間 3,222 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,336 KB
testcase_01 AC 36 ms
53,336 KB
testcase_02 AC 34 ms
53,336 KB
testcase_03 AC 33 ms
53,336 KB
testcase_04 AC 35 ms
53,336 KB
testcase_05 AC 35 ms
53,336 KB
testcase_06 AC 37 ms
53,336 KB
testcase_07 AC 37 ms
53,336 KB
testcase_08 AC 35 ms
53,336 KB
testcase_09 AC 34 ms
53,336 KB
testcase_10 AC 34 ms
53,336 KB
testcase_11 AC 34 ms
53,336 KB
testcase_12 AC 99 ms
75,596 KB
testcase_13 AC 141 ms
75,656 KB
testcase_14 AC 124 ms
75,592 KB
testcase_15 AC 104 ms
75,664 KB
testcase_16 AC 113 ms
75,636 KB
testcase_17 AC 45 ms
58,868 KB
testcase_18 AC 154 ms
75,672 KB
testcase_19 AC 158 ms
75,708 KB
testcase_20 AC 160 ms
75,708 KB
testcase_21 AC 143 ms
75,620 KB
testcase_22 AC 156 ms
75,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int,input().split())
mod = 10**9+7
for i in range(1, M+1):
    if i == 1:
        print(N)
    else:
        a = int((N+1)/i)
        if a < 2:
            print(0)
        elif N == a*i-1:
            print((pow(a, i-1, mod)*(a-1))%mod)
        else:
            print((pow(a, (1+a)*i-N-2, mod)*pow(a+1, N-a*i+1, mod)*(a-1))%mod)
0