結果

問題 No.2090 否定論理積と充足可能性
ユーザー titan23titan23
提出日時 2022-09-30 21:57:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 976 bytes
コンパイル時間 2,531 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 73,604 KB
最終ジャッジ日時 2023-08-24 15:28:26
合計ジャッジ時間 3,725 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
73,056 KB
testcase_01 AC 109 ms
73,056 KB
testcase_02 AC 111 ms
72,848 KB
testcase_03 AC 111 ms
73,192 KB
testcase_04 WA -
testcase_05 AC 111 ms
73,104 KB
testcase_06 AC 113 ms
73,296 KB
testcase_07 AC 110 ms
73,056 KB
testcase_08 AC 110 ms
73,452 KB
testcase_09 AC 109 ms
73,140 KB
testcase_10 WA -
testcase_11 AC 112 ms
73,508 KB
testcase_12 AC 112 ms
73,092 KB
testcase_13 AC 112 ms
73,264 KB
testcase_14 AC 111 ms
72,980 KB
testcase_15 AC 111 ms
73,108 KB
testcase_16 AC 110 ms
73,140 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 111 ms
73,168 KB
権限があれば一括ダウンロードができます

ソースコード

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