結果

問題 No.2456 Stamp Art
ユーザー tailstails
提出日時 2023-09-03 00:50:45
言語 cLay
(20240104-1)
結果
AC  
実行時間 161 ms / 5,000 ms
コード長 433 bytes
コンパイル時間 2,296 ms
コンパイル使用メモリ 162,064 KB
実行使用メモリ 67,232 KB
最終ジャッジ日時 2023-09-03 00:50:52
合計ジャッジ時間 6,132 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 120 ms
66,964 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 143 ms
67,232 KB
testcase_07 AC 115 ms
67,020 KB
testcase_08 AC 104 ms
67,024 KB
testcase_09 AC 125 ms
67,020 KB
testcase_10 AC 161 ms
67,016 KB
testcase_11 AC 127 ms
67,016 KB
testcase_12 AC 128 ms
67,024 KB
testcase_13 AC 156 ms
66,964 KB
testcase_14 AC 158 ms
67,080 KB
testcase_15 AC 121 ms
66,972 KB
testcase_16 AC 69 ms
35,748 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 84 ms
46,208 KB
testcase_20 AC 136 ms
67,044 KB
testcase_21 AC 129 ms
61,104 KB
testcase_22 AC 144 ms
67,192 KB
testcase_23 AC 9 ms
6,784 KB
testcase_24 AC 14 ms
8,920 KB
testcase_25 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@h,@w,a[h+1][w+1]{},c[][]{},d[w],n=0;
rrep(y,h){
	rrep(x,w){
		char@s;
		if(s=='#'){
			a[y][x]=min(a[y][x+1],a[y+1][x],a[y+1][x+1])+1;
			n+=1;
		}
	}
}
ll ok=1,ng=h+1;
while(ok+1<ng){
	d[0..w-1]=0;
	ll k=ok+ng>>1;
	ll m=n;
	rep(y,h){
		ll e=0;
		rep(x,w){
			if(a[y][x]>=k){
				c[y][x]+=1;
				c[y][x+k]-=1;
				c[y+k][x]-=1;
				c[y+k][x+k]+=1;
			}
			e+=d[x]+=c[y][x];
			c[y][x]=0;
			m-=e>0;
		}
	}
	(m?ng:ok)=k;
}
wt(ok);
0