結果

問題 No.1281 Cigarette Distribution
ユーザー AEn
提出日時 2022-05-27 16:35:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 82,332 KB
実行使用メモリ 76,508 KB
最終ジャッジ日時 2024-09-20 15:18:15
合計ジャッジ時間 3,390 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

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