結果
| 問題 |
No.2090 否定論理積と充足可能性
|
| コンテスト | |
| ユーザー |
momoyuu
|
| 提出日時 | 2022-10-15 01:39:18 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,581 bytes |
| コンパイル時間 | 3,182 ms |
| コンパイル使用メモリ | 261,268 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-26 19:05:20 |
| 合計ジャッジ時間 | 3,898 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template<class t> using vc = vector<t>;
template<class t> using vvc = vc<vc<t>>;
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using vi = vc<int>;
using vvi = vvc<int>;
using vl = vc<ll>;
using vvl = vvc<ll>;
#define rep(i,a,b) for (int i = (int)(a); i < (int)(b); i++)
#define irep(i,a,b) for (int i = (int)(a); i > (int)(b); i--)
#define all(a) a.begin(),a.end()
#define print(n) cout << n << '\n'
#define pritn(n) print(n)
#define printv(n,a) {copy(all(n),ostream_iterator<a>(cout," ")); cout<<"\n";}
#define printvv(n,a) {for(auto itr:n) printv(itr,a);}
#define rup(a,b) (a+b-1)/b
#define input(A,N) rep(i,0,N) cin>>A[i]
#define chmax(a,b) a = max(a,b)
#define chmin(a,b) a = min(a,b)
int main(){
cout << fixed << setprecision(15);
vc<string> a(6);
input(a,6);
vc<string>b = a;
sort(all(b));
b.erase(unique(all(b)),b.end());
vi now(6);
rep(i,0,6){
int ni = lower_bound(all(b),a[i]) - b.begin();
now[i] = ni;
}
bool p = false;
for(int s = 0;s<(1<<now.size());s++){
vi nn(6);
rep(i,0,6){
if(s>>now[i]&1) nn[i] = 1;
else nn[i] = 0;
}
nn[1] = !(nn[0]&nn[1]);
nn[2] = !(nn[2]&nn[1]);
nn[4] = !(nn[3]&nn[4]);
nn[5] = !(nn[5]&nn[4]);
nn[2] = !(nn[2]&nn[5]);
if(nn[2]) p = true;
if(p) break;
}
if(p) print("YES");
else print("NO");
//system("pause");
return 0;
}
momoyuu