結果

問題 No.2696 Sign Creation
ユーザー tailstails
提出日時 2024-03-22 23:13:56
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 870 bytes
コンパイル時間 2,956 ms
コンパイル使用メモリ 185,416 KB
実行使用メモリ 28,352 KB
最終ジャッジ日時 2024-05-17 18:18:58
合計ジャッジ時間 4,998 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 3 ms
6,944 KB
testcase_09 WA -
testcase_10 AC 4 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 100 ms
26,440 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 85 ms
21,708 KB
testcase_17 AC 7 ms
11,076 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 3 ms
6,940 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 9 ms
11,848 KB
testcase_28 AC 9 ms
9,856 KB
testcase_29 AC 7 ms
9,728 KB
testcase_30 AC 8 ms
11,972 KB
testcase_31 AC 244 ms
28,352 KB
testcase_32 AC 2 ms
7,616 KB
testcase_33 AC 2 ms
6,940 KB
testcase_34 WA -
testcase_35 AC 2 ms
6,940 KB
testcase_36 AC 2 ms
6,944 KB
testcase_37 AC 2 ms
6,940 KB
testcase_38 AC 2 ms
6,940 KB
testcase_39 AC 2 ms
6,944 KB
testcase_40 AC 2 ms
6,944 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