結果

問題 No.883 ぬりえ
ユーザー tailstails
提出日時 2019-09-13 22:44:20
言語 Perl
(5.38.2)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 9,208 KB
最終ジャッジ日時 2023-09-17 15:30:49
合計ジャッジ時間 1,808 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,152 KB
testcase_01 AC 6 ms
5,040 KB
testcase_02 AC 6 ms
5,104 KB
testcase_03 AC 6 ms
5,168 KB
testcase_04 AC 6 ms
5,084 KB
testcase_05 AC 6 ms
5,044 KB
testcase_06 AC 6 ms
5,064 KB
testcase_07 AC 6 ms
5,316 KB
testcase_08 AC 6 ms
5,292 KB
testcase_09 AC 6 ms
5,376 KB
testcase_10 AC 6 ms
5,044 KB
testcase_11 AC 6 ms
5,284 KB
testcase_12 AC 6 ms
5,088 KB
testcase_13 AC 6 ms
5,104 KB
testcase_14 AC 6 ms
5,400 KB
testcase_15 AC 138 ms
9,208 KB
testcase_16 AC 40 ms
6,352 KB
testcase_17 AC 21 ms
5,964 KB
testcase_18 AC 7 ms
5,308 KB
testcase_19 AC 7 ms
5,108 KB
testcase_20 AC 6 ms
5,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

($n,$k)=glob<>;
$m=int(($n-1)/$k)+1;
++$m while $m*$m<$n;
print$m,$/;
for(0..$n-1){
	while($a[$y][$x]){
		$x=($x+1)%$m;
	}
	$a[$y][$x]=1;
	$x=($x+1)%$m;
	$y=($y+1)%$m;
}

for$y(0..$m-1){
	for$x(0..$m-1){
		if($a[$y][$x]){
			print'#';
		}else{
			print'.';
		}
	}
	print$/;
}
0