結果

問題 No.336 門松列列
ユーザー HIROPON87069639HIROPON87069639
提出日時 2016-02-13 02:06:31
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 428 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 7,136 KB
実行使用メモリ 23,312 KB
最終ジャッジ日時 2023-10-22 04:47:37
合計ジャッジ時間 7,116 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# 2016.2.12

N = input()
alpha = [0 for i in range(0, N)]
beta = [0 for i in range(0, N)]
alpha[0] = 4
alpha[1] = 2
beta[0] = 4
beta[1] = 2
for i in xrange(3, N):
    beta[0] += alpha[0]
    beta[1] += alpha[0] * (i - 1)
    for j in xrange(1, i-1):
        tmp = alpha[j]
        beta[j-1] += tmp * j
        beta[j] += tmp
        beta[j+1] += tmp * (i - 1 - j)
    alpha = [be for be in beta[0:N]]
print alpha[0] % 1000000007
0