結果

問題 No.2090 否定論理積と充足可能性
ユーザー titan23
提出日時 2022-09-30 21:57:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 976 bytes
コンパイル時間 966 ms
コンパイル使用メモリ 82,156 KB
実行使用メモリ 57,544 KB
最終ジャッジ日時 2024-12-22 23:33:48
合計ジャッジ時間 2,687 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

'''input

'''
import sys
import math
from bisect import bisect_right, bisect_left
from itertools import *
from collections import *
from heapq import heapify, heappush, heappop
import random
inf = float('inf')
# mod = 1000000007
# mod = 998244353
input = lambda: sys.stdin.readline().rstrip()
def error(*args, sep=' ', end='\n'):
  print(*args, sep=sep, end=end, file=sys.stderr)
# sys.setrecursionlimit(10**6)

#  -----------------------  #

def nand(p, q):
  return ~(p & q)

A = list(map(int, input().split()))
dic = defaultdict(list)
for i in range(6):
  dic[A[i]].append(i)
st = set()
for v in dic.values():
  st.add(tuple(v))

for i in range(1<<6):
  p = []
  for j in range(6):
    if (i >> j & 1):
      p.append(1)
    else:
      p.append(0)
  for s in st:
    e = p[s[0]]
    for ele in s:
      if p[ele] != e:
        break
  else:
    res = nand(nand(nand(p[0], p[1]), p[2]), nand(nand(p[3], p[4]), p[5]))
    if res:
      print('YES')
      exit()
print('NO')
0