結果

問題 No.533 Mysterious Stairs
ユーザー tookunn_1213tookunn_1213
提出日時 2017-06-23 23:10:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 491 ms / 5,000 ms
コード長 255 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 178,616 KB
最終ジャッジ日時 2024-04-15 01:02:12
合計ジャッジ時間 3,856 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,440 KB
testcase_01 AC 38 ms
52,872 KB
testcase_02 AC 34 ms
53,232 KB
testcase_03 AC 35 ms
53,508 KB
testcase_04 AC 35 ms
53,388 KB
testcase_05 AC 35 ms
53,404 KB
testcase_06 AC 36 ms
53,448 KB
testcase_07 AC 36 ms
53,212 KB
testcase_08 AC 37 ms
53,196 KB
testcase_09 AC 36 ms
53,280 KB
testcase_10 AC 40 ms
59,464 KB
testcase_11 AC 45 ms
62,916 KB
testcase_12 AC 47 ms
64,624 KB
testcase_13 AC 48 ms
63,672 KB
testcase_14 AC 47 ms
64,500 KB
testcase_15 AC 50 ms
65,868 KB
testcase_16 AC 51 ms
67,220 KB
testcase_17 AC 52 ms
68,996 KB
testcase_18 AC 51 ms
71,112 KB
testcase_19 AC 52 ms
72,500 KB
testcase_20 AC 102 ms
87,668 KB
testcase_21 AC 107 ms
88,860 KB
testcase_22 AC 223 ms
115,436 KB
testcase_23 AC 487 ms
177,420 KB
testcase_24 AC 491 ms
178,616 KB
testcase_25 AC 103 ms
87,712 KB
testcase_26 AC 423 ms
164,756 KB
testcase_27 AC 165 ms
102,428 KB
権限があれば一括ダウンロードができます

ソースコード

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