結果

問題 No.1521 Playing Musical Chairs Alone
ユーザー mkawa2mkawa2
提出日時 2021-05-28 21:58:14
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,129 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 65,152 KB
最終ジャッジ日時 2024-04-25 00:06:06
合計ジャッジ時間 2,240 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,224 KB
testcase_01 AC 38 ms
52,096 KB
testcase_02 AC 44 ms
59,264 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 49 ms
61,056 KB
testcase_06 AC 47 ms
60,800 KB
testcase_07 AC 48 ms
61,440 KB
testcase_08 AC 48 ms
59,520 KB
testcase_09 AC 52 ms
60,288 KB
testcase_10 AC 41 ms
58,496 KB
testcase_11 AC 50 ms
61,056 KB
testcase_12 AC 37 ms
52,224 KB
testcase_13 RE -
testcase_14 AC 42 ms
58,752 KB
testcase_15 AC 49 ms
61,056 KB
testcase_16 AC 51 ms
61,184 KB
testcase_17 AC 50 ms
60,928 KB
testcase_18 AC 49 ms
60,928 KB
testcase_19 AC 52 ms
61,440 KB
testcase_20 AC 49 ms
61,184 KB
testcase_21 AC 50 ms
61,312 KB
testcase_22 RE -
testcase_23 AC 50 ms
60,928 KB
testcase_24 AC 54 ms
61,440 KB
testcase_25 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
dij = [(0, 1), (1, 0), (1, 1), (1, -1)]
inf = 10**16
# md = 998244353
md = 10**9+7

def merge(aa, bb):
    res = [0]*n
    for i, a in enumerate(aa):
        for j, b in enumerate(bb):
            res[(i+j)%n] = (a*b+res[(i+j)%n])%md
    return res

n, k, l = LI()
base = [0]*n
for i in range(1, l+1): base[i] = 1
if n == l: base[0] = 1
ans = [1]+[0]*(n-1)
while k:
    if k & 1: ans = merge(ans, base)
    base = merge(base, base)
    k >>= 1

print(*ans,sep="\n")
0