結果

問題 No.533 Mysterious Stairs
ユーザー tookunn_1213tookunn_1213
提出日時 2017-06-23 23:10:15
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
TLE  
実行時間 -
コード長 255 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 194,572 KB
最終ジャッジ日時 2023-07-27 12:59:13
合計ジャッジ時間 12,551 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
194,572 KB
testcase_01 AC 15 ms
7,900 KB
testcase_02 AC 16 ms
7,832 KB
testcase_03 AC 16 ms
7,988 KB
testcase_04 AC 15 ms
7,952 KB
testcase_05 AC 16 ms
7,856 KB
testcase_06 AC 16 ms
7,840 KB
testcase_07 AC 16 ms
7,948 KB
testcase_08 AC 16 ms
7,792 KB
testcase_09 AC 16 ms
7,792 KB
testcase_10 AC 16 ms
7,868 KB
testcase_11 AC 18 ms
7,832 KB
testcase_12 AC 20 ms
7,888 KB
testcase_13 AC 22 ms
8,236 KB
testcase_14 AC 23 ms
8,260 KB
testcase_15 AC 27 ms
8,360 KB
testcase_16 AC 37 ms
8,624 KB
testcase_17 AC 53 ms
9,180 KB
testcase_18 AC 69 ms
9,720 KB
testcase_19 AC 84 ms
10,084 KB
testcase_20 AC 779 ms
29,976 KB
testcase_21 AC 878 ms
32,308 KB
testcase_22 AC 2,769 ms
83,320 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
MOD = 10**9+7
dp = [[0 for j in range(4)] for i in range(N+1)]
dp[0][0] = 1
for i in range(N):
	for j in range(4):
		for k in range(1,4):
			if j == k:
				continue
			if i+k <= N:
				dp[i+k][k] += dp[i][j] % MOD
print(sum(dp[N]) % MOD)
0