結果

問題 No.2536 同値性と充足可能性
ユーザー tailstails
提出日時 2023-11-10 22:14:16
言語 cLay
(20240104-1)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 3,241 ms
コンパイル使用メモリ 177,888 KB
実行使用メモリ 12,224 KB
最終ジャッジ日時 2023-11-10 22:14:21
合計ジャッジ時間 5,118 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,616 KB
testcase_01 AC 2 ms
7,616 KB
testcase_02 AC 2 ms
7,616 KB
testcase_03 AC 2 ms
7,616 KB
testcase_04 AC 2 ms
7,616 KB
testcase_05 AC 2 ms
7,616 KB
testcase_06 AC 2 ms
7,616 KB
testcase_07 AC 2 ms
7,616 KB
testcase_08 AC 2 ms
7,616 KB
testcase_09 AC 2 ms
7,616 KB
testcase_10 AC 2 ms
7,616 KB
testcase_11 AC 2 ms
7,616 KB
testcase_12 AC 2 ms
7,616 KB
testcase_13 AC 2 ms
7,616 KB
testcase_14 AC 2 ms
7,616 KB
testcase_15 AC 3 ms
7,616 KB
testcase_16 AC 2 ms
7,616 KB
testcase_17 AC 2 ms
7,616 KB
testcase_18 AC 3 ms
7,616 KB
testcase_19 AC 3 ms
7,616 KB
testcase_20 AC 2 ms
7,616 KB
testcase_21 AC 2 ms
7,616 KB
testcase_22 AC 2 ms
7,616 KB
testcase_23 AC 4 ms
8,768 KB
testcase_24 AC 3 ms
8,768 KB
testcase_25 AC 17 ms
12,096 KB
testcase_26 AC 17 ms
12,096 KB
testcase_27 AC 17 ms
12,224 KB
testcase_28 AC 17 ms
12,096 KB
testcase_29 AC 17 ms
12,096 KB
testcase_30 AC 16 ms
12,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@n,@m,x[n],y=0,z[2n]{};
unionFind u('m',2n,1);
rep(m){
	ll@i;
	string@e;
	ll@j;
	if(e[2]=='='){
		u(2i-2,2j-2);
		u(2i-1,2j-1);
	}else{
		u(2i-2,2j-1);
		u(2i-1,2j-2);
	}
	if(u(2i-2)==u(2i-1)){
		wt("No");
		exit(0);
	}
}
rep(i,n){
	z[u(2i)]+=1;
}
rep(i,n){
	ll r=u(2i);
	if(z[r]>z[r^1]||z[r]==z[r^1]&&r%2==0){
		x[y++]=i+1;
	}
}
wtLn("Yes",y);
wt(x(y));
0