結果

問題 No.533 Mysterious Stairs
ユーザー ねずねず
提出日時 2018-01-27 07:53:07
言語 PHP
(8.3.4)
結果
AC  
実行時間 110 ms / 5,000 ms
コード長 191 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 12,076 KB
実行使用メモリ 30,512 KB
最終ジャッジ日時 2023-08-27 23:26:39
合計ジャッジ時間 2,195 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
12,156 KB
testcase_01 AC 7 ms
12,184 KB
testcase_02 AC 7 ms
12,180 KB
testcase_03 AC 7 ms
12,196 KB
testcase_04 AC 7 ms
12,132 KB
testcase_05 AC 8 ms
12,212 KB
testcase_06 AC 7 ms
12,264 KB
testcase_07 AC 7 ms
12,256 KB
testcase_08 AC 7 ms
12,208 KB
testcase_09 AC 7 ms
12,148 KB
testcase_10 AC 8 ms
12,220 KB
testcase_11 AC 7 ms
12,196 KB
testcase_12 AC 7 ms
12,264 KB
testcase_13 AC 8 ms
12,304 KB
testcase_14 AC 7 ms
12,176 KB
testcase_15 AC 7 ms
12,152 KB
testcase_16 AC 7 ms
12,172 KB
testcase_17 AC 8 ms
12,224 KB
testcase_18 AC 8 ms
12,256 KB
testcase_19 AC 8 ms
12,132 KB
testcase_20 AC 18 ms
13,728 KB
testcase_21 AC 20 ms
13,724 KB
testcase_22 AC 46 ms
18,180 KB
testcase_23 AC 108 ms
30,400 KB
testcase_24 AC 110 ms
30,512 KB
testcase_25 AC 18 ms
13,696 KB
testcase_26 AC 95 ms
30,372 KB
testcase_27 AC 33 ms
17,984 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n = trim(fgets(STDIN));
$a = array(0,1,1,3,3,4,8);
$m = 1000000007;
for ($i = 7; $i <= $n; $i++) {
	$a[] = ($a[$i-3]+$a[$i-4]+$a[$i-5]+2*$a[$i-6]) % $m;
}
echo $a[$n];
echo PHP_EOL;
?>
0