結果

問題 No.336 門松列列
ユーザー tailstails
提出日時 2016-01-15 23:49:39
言語 Perl
(5.38.0)
結果
AC  
実行時間 449 ms / 2,000 ms
コード長 162 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 7,128 KB
実行使用メモリ 4,816 KB
最終ジャッジ日時 2023-09-02 18:44:32
合計ジャッジ時間 3,988 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 358 ms
4,632 KB
testcase_01 AC 2 ms
4,520 KB
testcase_02 AC 3 ms
4,480 KB
testcase_03 AC 2 ms
4,476 KB
testcase_04 AC 449 ms
4,816 KB
testcase_05 AC 2 ms
4,512 KB
testcase_06 AC 52 ms
4,552 KB
testcase_07 AC 158 ms
4,708 KB
testcase_08 AC 286 ms
4,612 KB
testcase_09 AC 431 ms
4,708 KB
testcase_10 AC 444 ms
4,748 KB
testcase_11 AC 449 ms
4,660 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$n=<>;
if($n>2){
	$a[0]=1;
	for$i(1..$n-1){
		$b[0]=$a[$i-1];
		for$j(1..$i){
			$b[$j]=($b[$j-1]+$a[$i-$j])%(1e9+7);
		}
		@a=@b,@b=();
	}
}
print$a[0]*2%(1e9+7)
0