結果

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

ソースコード

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)*(a-1))%mod)
0