結果
| 問題 |
No.541 3 x N グリッド上のサイクルの個数
|
| コンテスト | |
| ユーザー |
%20
|
| 提出日時 | 2017-09-01 21:33:21 |
| 言語 | Perl (5.40.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 2,000 ms |
| コード長 | 459 bytes |
| コンパイル時間 | 76 ms |
| コンパイル使用メモリ | 5,248 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-11-06 17:30:01 |
| 合計ジャッジ時間 | 2,800 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 62 |
コンパイルメッセージ
Main.pl syntax OK
ソースコード
sub mul{
my@C;
for$y(0..9){
for$x(0..9){
for(0..9){
($C[$y][$x]+=$Z[$y][$_]*$_[$_][$x])%=1e9+7
}
}
}
@C
}
@@=(
[1,1,1,1,1,1,1,1,0,0],
[0,1,1,1,0,0,0,1,0,1],
[0,1,1,1,1,1,0,0,0,1],
[0,1,1,1,1,1,1,0,1,1],
[0,0,1,1,1,1,0,0,0,1],
[0,0,1,1,1,1,1,0,0,1],
[0,0,0,1,0,1,1,1,0,1],
[0,0,0,1,0,0,0,1,0,0],
[0,1,0,0,0,0,1,0,1,1],
[0,0,0,0,0,0,0,0,0,1]
);
$Z[$_][$_]=1for 0..9;
$N=<>;
(@Z=mul@Z),$N+1>>$=&1and@Z=mul@@while$=--;
print$Z[0][9]
%20