結果

問題 No.1281 Cigarette Distribution
ユーザー taiga000629taiga000629
提出日時 2020-11-06 21:57:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 485 bytes
コンパイル時間 615 ms
コンパイル使用メモリ 86,880 KB
実行使用メモリ 77,452 KB
最終ジャッジ日時 2023-09-29 18:41:46
合計ジャッジ時間 4,117 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,256 KB
testcase_01 AC 69 ms
71,248 KB
testcase_02 AC 68 ms
71,180 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>1:
                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