結果

問題 No.1281 Cigarette Distribution
ユーザー taiga000629taiga000629
提出日時 2020-11-06 22:35:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 487 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 77,456 KB
最終ジャッジ日時 2023-09-29 19:14:37
合計ジャッジ時間 4,414 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,948 KB
testcase_01 AC 70 ms
71,388 KB
testcase_02 AC 71 ms
71,248 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
mod=10**9+7
for x in range(1,m+1):
    if x==n:
        print(0)
    else:
        if n%x==0:
            print(pow(n//x,x,mod))
        else:
            hon=n//x
            amari=n-x*hon
            if hon>=0:
                print(pow(hon+1,amari,mod)*pow(hon,x-amari,mod)%mod)
            else:
                if x-amari>1:
                    print(0)
                else:
                    print(pow(hon+1,amari,mod)*pow(hon,x-amari,mod)%mod)




0