結果
問題 | No.2090 否定論理積と充足可能性 |
ユーザー |
|
提出日時 | 2022-09-30 21:59:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,168 bytes |
コンパイル時間 | 2,068 ms |
コンパイル使用メモリ | 179,840 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-22 23:36:08 |
合計ジャッジ時間 | 2,825 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 4 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;using pll = pair<ll, ll>;#define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i)#define rep(i, n) drep(i, 0, n - 1)#define all(a) (a).begin(), (a).end()#define pb push_back#define fi first#define se secondconst ll MOD = 1000000007;const ll MOD2 = 998244353;const ll INF = 1LL << 60;const ll MAX_N = 2e5;int main(){vector<string> a(6);rep(i, 6) cin >> a[i];vector<string> b(6);rep(i, 6) b[i] = a[i];sort(all(b));b.erase(unique(all(b)), b.end());ll n = (ll)b.size();vector<ll> c(6);rep(i, 6) c[i] = lower_bound(all(b), a[i]) - b.begin();rep(bit, (1<<n)){bool ans1 = (bit>>c[0])&1;ans1 = ~ans1;ans1 = ans1 | ~((bit>>c[1])&1);ans1 = ~ans1;ans1 = ans1 | ~((bit>>c[2])&1);bool ans2 = (bit>>c[3])&1;ans2 = ~ans2;ans2 = ans2 | ~((bit>>c[4])&1);ans2 = ~ans2;ans2 = ans2 | ~((bit>>c[5])&1);bool ans = (~ans1) | (~ans2);if(ans){cout << "YES" << endl;return 0;}}cout << "NO" << endl;}