結果
問題 | No.2090 否定論理積と充足可能性 |
ユーザー |
![]() |
提出日時 | 2022-09-30 22:20:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 672 bytes |
コンパイル時間 | 2,398 ms |
コンパイル使用メモリ | 179,888 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 00:04:35 |
合計ジャッジ時間 | 3,046 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; using ld=long double; using P=pair<ll,ll>; using V=vector<ll>; #define rep(i,n) for(ll i=0;i<n;i++) #define REP(i,n) for(ll i=1;i<=n;i++) int nd(int x,int y){ if(x&&y) return 0; else return 1; } int main(){ vector<string> s(6),t; rep(i,6) cin >> s[i]; t=s; sort(t.begin(),t.end()); V a(6); rep(i,6) rep(j,6) if(s[i]==t[j]) a[i]=j; bool flag=false; rep(i,64){ V b(6); rep(j,6) b[j]=(i>>a[j])&1; if(nd(nd(nd(b[0],b[1]),b[2]),nd(nd(b[3],b[4]),b[5]))) flag=true; } if(flag) cout << "YES" << endl; else cout << "NO" << endl; }