結果

問題 No.554 recurrence formula
ユーザー yamanchu3776yamanchu3776
提出日時 2017-08-23 12:08:01
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 367 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 24,320 KB
最終ジャッジ日時 2024-04-23 13:06:14
合計ジャッジ時間 3,931 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
12,032 KB
testcase_01 AC 12 ms
6,400 KB
testcase_02 AC 12 ms
6,528 KB
testcase_03 AC 12 ms
6,400 KB
testcase_04 AC 11 ms
6,528 KB
testcase_05 AC 11 ms
6,272 KB
testcase_06 AC 13 ms
6,400 KB
testcase_07 AC 12 ms
6,528 KB
testcase_08 AC 12 ms
6,400 KB
testcase_09 AC 12 ms
6,400 KB
testcase_10 AC 146 ms
7,680 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
num = int(raw_input())

def gusu(i, an):
	aa = 0
	for j in range(i/2):
		aa += an[2*j]
	aa = aa * i
	return aa

def kisu(i, an):
	aa = 0
	for j in range(i/2):
		aa += an[2*j+1]
	aa = aa * i
	return aa

an = []
an.append(1)
for i in range(num-1):
	i=i+2
	if i %2 == 0:
		an.append(gusu(i, an))
	else:
		an.append(kisu(i, an))

print an[-1]%1000000007





0