結果
問題 |
No.2536 同値性と充足可能性
|
ユーザー |
👑 |
提出日時 | 2023-08-14 00:42:20 |
言語 | cLay (20241019-1) |
結果 |
AC
|
実行時間 | 18 ms / 2,000 ms |
コード長 | 300 bytes |
コンパイル時間 | 4,049 ms |
コンパイル使用メモリ | 178,076 KB |
実行使用メモリ | 7,728 KB |
最終ジャッジ日時 | 2024-12-14 02:25:13 |
合計ジャッジ時間 | 5,158 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:314:20: warning: narrowing conversion of ‘(2 * N)’ from ‘long long int’ to ‘int’ [-Wnarrowing] 314 | unionFind u{'m',2*N,1}; | ~^~
ソースコード
ll@N,@M,i,j,a,b,c=0,C[2N]={};string E;unionFind u{'m',2N,1};rep(M)rd(i--,E,j--),b=E[2]<'=',u(i,j+N*b),u(i+N,j+N-N*b);rep(i,N){a=u(i),b=u(i+N);if(a==b)wt("No"),exit(0);if(!C[a])C[a]=1,C[b]=2;c+=C[a]<2;}if(2c<N)b=1,c=N-c;else b=0;wtLn("Yes",c);VI v{};rep(i,N){if((C[u(i)]<2)!=b)v.push_back(i+1);}wt(v);