結果

問題 No.1281 Cigarette Distribution
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-24 03:26:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 486 bytes
コンパイル時間 801 ms
コンパイル使用メモリ 81,768 KB
実行使用メモリ 75,876 KB
最終ジャッジ日時 2023-10-21 15:32:33
合計ジャッジ時間 3,907 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N, M = map(int, input().split())
P = 10 ** 9 + 7

for X in range(1, M + 1):
    if X == 1:
        print(N)
    elif X == 2:
        a = N // 2 + 1
        b = N // 2
        print(a * b)
    elif N < 2 * X - 1:
        print(0)
    else:
        m = N - (2 * X - 1)
        div, mod = divmod(m, X)
        a = div + 3
        b = div + 2
        c = div + 1
        na = mod
        nb = X - 1 - mod
        nc = 1
        res = pow(a, na, P) * pow(b, nb, P) * c % P
        print(res)
0