結果

問題 No.1398 調和の魔法陣 (構築)
ユーザー tailstails
提出日時 2021-02-19 22:09:35
言語 Perl
(5.38.2)
結果
AC  
実行時間 142 ms / 3,153 ms
コード長 246 bytes
コンパイル時間 435 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 5,312 KB
最終ジャッジ日時 2023-10-15 02:00:52
合計ジャッジ時間 28,612 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,112 KB
testcase_01 AC 6 ms
5,216 KB
testcase_02 AC 6 ms
5,180 KB
testcase_03 AC 6 ms
5,252 KB
testcase_04 AC 6 ms
5,060 KB
testcase_05 AC 7 ms
5,292 KB
testcase_06 AC 140 ms
5,300 KB
testcase_07 AC 6 ms
5,112 KB
testcase_08 AC 133 ms
5,308 KB
testcase_09 AC 140 ms
5,212 KB
testcase_10 AC 6 ms
5,104 KB
testcase_11 AC 140 ms
5,064 KB
testcase_12 AC 6 ms
5,060 KB
testcase_13 AC 132 ms
4,996 KB
testcase_14 AC 141 ms
5,200 KB
testcase_15 AC 6 ms
5,284 KB
testcase_16 AC 117 ms
5,056 KB
testcase_17 AC 127 ms
5,256 KB
testcase_18 AC 133 ms
5,220 KB
testcase_19 AC 141 ms
5,184 KB
testcase_20 AC 6 ms
5,304 KB
testcase_21 AC 133 ms
5,116 KB
testcase_22 AC 140 ms
5,144 KB
testcase_23 AC 6 ms
5,312 KB
testcase_24 AC 140 ms
5,108 KB
testcase_25 AC 7 ms
5,204 KB
testcase_26 AC 134 ms
4,976 KB
testcase_27 AC 142 ms
5,212 KB
testcase_28 AC 6 ms
5,284 KB
testcase_29 AC 141 ms
5,112 KB
testcase_30 AC 7 ms
5,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::a" used only once: possible typo at Main.pl line 12.
Main.pl syntax OK

ソースコード

diff #

($w,$h,$z)=glob<>;
$s=$w%3==2?2:1;
$t=$h%3==2?2:1;

if($z>$s*$t*9){
	print "-1\n";
	exit;
}

for$y(0..$h-1){
	for$x(0..$w-1){
		print $a[$y%3*3+$x%3]//=$y%3==2||($h-$y)%3==0||$x%3==2||($w-$x)%3==0?0:$z>9?($z-=9,9):($t=$z,$z=0,$t);
	}
	print$/;
}
0