結果

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

ソースコード

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:
            if a%2 == 0:
                print((pow(a, i-1, mod)*(a-1))%mod)
            else:
                print((a*pow(a-1, i-1, mod))%mod)
        else:
            print((pow(a, (1+a)*i-N-2, mod)*pow(a+1, N-a*i+1, mod))%mod)
0