結果
問題 | No.2090 否定論理積と充足可能性 |
ユーザー |
|
提出日時 | 2022-09-30 21:52:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 482 bytes |
コンパイル時間 | 2,165 ms |
コンパイル使用メモリ | 202,752 KB |
最終ジャッジ日時 | 2025-02-07 19:23:14 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include<bits/stdc++.h>using namespace std;int main(){ios::sync_with_stdio(false);cin.tie(nullptr);map<string,int>a;vector<int>A(6);for(int i=0,cnt=0;i<6;i++){string S;cin>>S;if(a.find(S)!=a.end()){A[i]=a[S];}else{A[i]=cnt;a[S]=cnt++;}}bool ans=false;for(int i=0;i<1<<6;i++){ans|=~(~(~((i>>A[0]&1)&(i>>A[1]&1))&(i>>A[2]&1))&~(~((i>>A[3]&1)&(i>>A[4]&1))&(i>>A[5]&1)));}cout<<(ans?"YES\n":"NO\n");}