結果
| 問題 |
No.541 3 x N グリッド上のサイクルの個数
|
| コンテスト | |
| ユーザー |
%20
|
| 提出日時 | 2017-09-01 21:16:51 |
| 言語 | Perl (5.40.0) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 2,000 ms |
| コード長 | 497 bytes |
| コンパイル時間 | 361 ms |
| コンパイル使用メモリ | 5,248 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-11-06 17:29:22 |
| 合計ジャッジ時間 | 3,591 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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]+=(@{$_[0]})[$y][$_]*(@{$_[1]})[$_][$x])%=1e9+7
}
}
}
[@C]
}
@T=(
[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],[@Z]},$N+1>>$=&1and@Z=@{;mul[@Z],[@T]}while$=--;
print$Z[0][9]
%20