結果

問題 No.2696 Sign Creation
ユーザー tailstails
提出日時 2024-03-22 23:13:56
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 870 bytes
コンパイル時間 3,316 ms
コンパイル使用メモリ 184,884 KB
実行使用メモリ 30,272 KB
最終ジャッジ日時 2024-03-22 23:14:03
合計ジャッジ時間 6,301 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,488 KB
testcase_01 AC 2 ms
7,488 KB
testcase_02 AC 2 ms
7,488 KB
testcase_03 AC 3 ms
7,488 KB
testcase_04 AC 3 ms
7,488 KB
testcase_05 AC 2 ms
7,488 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 5 ms
7,744 KB
testcase_09 WA -
testcase_10 AC 5 ms
8,128 KB
testcase_11 AC 3 ms
7,744 KB
testcase_12 AC 3 ms
7,744 KB
testcase_13 AC 177 ms
28,480 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 118 ms
23,616 KB
testcase_17 AC 8 ms
13,120 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 3 ms
8,000 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 9 ms
13,760 KB
testcase_28 AC 9 ms
13,760 KB
testcase_29 AC 9 ms
13,632 KB
testcase_30 AC 10 ms
13,888 KB
testcase_31 AC 448 ms
30,272 KB
testcase_32 AC 2 ms
7,488 KB
testcase_33 AC 3 ms
7,616 KB
testcase_34 WA -
testcase_35 AC 3 ms
7,488 KB
testcase_36 AC 3 ms
7,488 KB
testcase_37 AC 2 ms
7,488 KB
testcase_38 AC 3 ms
7,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@h,@w,@n,@d,@(x--,y--)[n],f[h][w]{},z=0,inc=0,dec=0;
unionFind u('m',n+1,1);
rep(i,n){
	f[x[i]][y[i]]=i+1;
	rep(a,x[i]-d,x[i]+d+1){
		if(a>=0&&a<h){
			ll e=d-abs(a-x[i]);
			rep(b,y[i]-e,y[i]+e+1){
				if(b>=0&&b<w){
					if(f[a][b]){
						u(i+1,f[a][b]);
					}
				}
			}
		}
	}
}
unordered_set<ll> s[h][w]; //!!
rep(i,n){
	if(u.size(i+1)>1){
		ll r=u(i+1);
		z+=i==r;
		rep(a,x[i]-d,x[i]+d+1){
			if(a>=0&&a<h){
				ll e=d-abs(a-x[i]);
				rep(b,y[i]-e,y[i]+e+1){
					if(b>=0&&b<w){
						s[a][b].insert(r);
					}
				}
			}
		}
	}
}
rep(i,n){
	if(u.size(i+1)==1){
		rep(a,x[i]-d,x[i]+d+1){
			if(a>=0&&a<h){
				ll e=d-abs(a-x[i]);
				rep(b,y[i]-e,y[i]+e+1){
					if(b>=0&&b<w){
						if(!f[a][b]&&s[a][b].empty()){
							inc=1;
						}
					}
				}
			}
		}
	}
}
rep(a,h){
	rep(b,w){
		if(!f[a][b]){
			dec>?=(ll)s[a][b].size()-1;
		}
	}
}
wt(z-dec,z+inc);
0