結果

問題 No.1281 Cigarette Distribution
ユーザー Azumabashi
提出日時 2020-11-08 14:56:27
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 730 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-07-22 15:08:13
合計ジャッジ時間 6,446 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n, m = map(int, input().split())
    mod = 10 ** 9 + 7
    for i in range(1, m + 1):
        q, r = divmod(n + 1, i)
        ans = q - 1
        ans *= pow(q + 1, r, mod)
        ans %= mod
        ans *= pow(q, i - r - 1, mod)
        ans %= mod
        print(ans)


if __name__ == '__main__':
    main()
0