結果

問題 No.2291 Union Find Estimate
ユーザー tailstails
提出日時 2023-05-05 22:25:43
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 560 bytes
コンパイル時間 4,066 ms
コンパイル使用メモリ 177,180 KB
実行使用メモリ 6,268 KB
最終ジャッジ日時 2024-05-02 17:07:47
合計ジャッジ時間 4,339 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 11 ms
5,376 KB
testcase_03 AC 26 ms
6,268 KB
testcase_04 AC 4 ms
5,376 KB
testcase_05 AC 5 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define MD 998244353
ll@w,@h;
unionFind u('m',w,1);
Mint z=Mint(10)**w;
ll b[w];
rep(j,w)b[j]=1023;
rep(h){
	string@q;
	ll a[26]{};
	rep(j,w){
		ll c=q[j];
		ll k=u(j);
		if(c>='0'&&c<='9'){
			c-='0';
			if(b[k]!=1<<c){
				z/=BIT_popcount(b[k]);
				b[k]&=1<<c;
				z*=BIT_popcount(b[k]);
			}
		}
		if(c>='a'&&c<='z'){
			c-='a';
			if(a[c]){
				ll d=u(a[c]-1);
				u(d,k);
				z/=BIT_popcount(b[d]);
				if(b[d]!=b[k]){
					z/=BIT_popcount(b[k]);
					b[u(d)]=b[d]&b[k];
					z*=BIT_popcount(b[u(d)]);
				}
			}else{
				a[c]=k+1;
			}
		}
	}
	wt(z);
}
0