結果

問題 No.1974 2x2 Flipper
ユーザー tailstails
提出日時 2022-06-10 22:07:38
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 579 ms
コンパイル使用メモリ 6,040 KB
実行使用メモリ 7,832 KB
最終ジャッジ日時 2023-10-21 05:14:02
合計ジャッジ時間 3,726 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
6,072 KB
testcase_01 AC 8 ms
6,104 KB
testcase_02 AC 8 ms
6,092 KB
testcase_03 AC 10 ms
7,160 KB
testcase_04 AC 9 ms
6,364 KB
testcase_05 WA -
testcase_06 AC 9 ms
6,628 KB
testcase_07 AC 9 ms
6,364 KB
testcase_08 AC 9 ms
6,184 KB
testcase_09 AC 10 ms
6,892 KB
testcase_10 WA -
testcase_11 AC 9 ms
6,628 KB
testcase_12 AC 10 ms
7,160 KB
testcase_13 AC 9 ms
6,628 KB
testcase_14 AC 9 ms
6,368 KB
testcase_15 AC 11 ms
7,420 KB
testcase_16 WA -
testcase_17 AC 9 ms
6,892 KB
testcase_18 AC 8 ms
6,244 KB
testcase_19 AC 9 ms
6,184 KB
testcase_20 AC 9 ms
6,368 KB
testcase_21 AC 11 ms
7,688 KB
testcase_22 AC 11 ms
7,832 KB
testcase_23 AC 11 ms
7,832 KB
testcase_24 WA -
testcase_25 AC 8 ms
6,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

($h,$w)=glob<>;
if($h&1){
	if($w&1){
		if($h==1){
			print 0,$/;
			print "@{[(0)x$w]}\n";
		}elsif($w==1){
			print 0,$/;
			print "0\n"x$h;
		}else{
			print +($h-1)*($w-1)+2,$/;
			print "@{[(1)x($w-1),0]}\n"x($h-2);
			print "@{[(1)x($w-2),0,1]}\n";
			print "@{[(0)x($w-2),1,1]}\n";
		}
	}else{
		print +($h-1)*$w,$/;
		print "@{[(1)x$w]}\n"x($h-1);
		print "@{[(0)x$w]}\n";
	}
}else{
	if($w&1){
		print $h*($w-1),$/;
		print "@{[(1)x($w-1),0]}\n"x$h;
	}else{
		print $h*$w,$/;
		print "@{[(1)x$w]}\n"x$h;
	}
}
0