結果

問題 No.2090 否定論理積と充足可能性
ユーザー keisuke6keisuke6
提出日時 2022-09-30 21:39:22
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 608 bytes
コンパイル時間 2,090 ms
コンパイル使用メモリ 202,560 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-24 15:02:41
合計ジャッジ時間 2,857 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 WA -
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
4,376 KB
testcase_16 WA -
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
bool f(bool p, bool q){
    return !(p && q);
}
signed main(){
  vector<string> S(6);
  int N = 6;
  for(int i=0;i<N;i++) cin>>S[i];
  for(int k=0;k<64;k++){
      bool ok = true;
      for(int i=0;i<N;i++)for(int j=i+1;j<N;j++)if(S[i] == S[j] && (((1<<i)&k) != ((1<<j)&k))){
          ok = false;
      }
      if(!ok) continue;
      vector<bool> A(N);
      for(int i=0;i<6;i++) A[i] = ((1<<i)&k);
      if(f(f(f(A[0],A[1]),A[2]),f(f(A[3],A[4]),A[5]))){
          cout<<"YES"<<endl;
          return 0;
      }
  }
  cout<<"NO"<<endl;
}
0