結果

問題 No.2090 否定論理積と充足可能性
ユーザー 👑 p-adicp-adic
提出日時 2022-08-27 19:54:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,037 bytes
コンパイル時間 1,019 ms
コンパイル使用メモリ 71,780 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 17:13:44
合計ジャッジ時間 1,893 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <stdio.h>
#include <stdint.h>
using namespace std;

using ll = long long;

#define CIN( LL , A ) LL A; cin >> A 
#define FOR_LL( VAR , INITIAL , FINAL_PLUS_ONE ) for( ll VAR = INITIAL ; VAR < FINAL_PLUS_ONE ; VAR ++ ) 
#define RETURN( ANSWER ) cout << ( ANSWER ) << endl; return 0 

int main()
{
  string A[6];
  FOR_LL( i , 0 , 6 ){
    cin >> A[i];
  }
  ll num[6] = {};
  ll num_lim = 1;
  FOR_LL( i , 1 , 6 ){
    string& Ai = A[i];
    bool searching = true;
    FOR_LL( j , 0 , i ){
      if( Ai == A[j] ){
	num[i] = num[j];
	j = i;
	searching = false;
      }
    }
    if( searching ){
      num[i] = num_lim;
      num_lim++;
    }
  }
  ll N = 1;
  FOR_LL( i , 0 , num_lim ){
    N *= 2;
  }
  bool b[6];
  FOR_LL( v , 0 , N ){
    FOR_LL( i , 0 , num_lim ){
      b[i] = ( v >> i ) % 2 == 1;
    }
    if( ! ( ! ( ( ! ( b[num[0]] && b[num[1]] ) ) && b[num[2]] ) ) && ( ! ( ( ! ( b[num[3]] && b[num[4]] ) ) && b[num[5]] ) ) ){
      RETURN( "YES" );
    }
  }
  RETURN( "NO" );
}
0