結果

問題 No.2090 否定論理積と充足可能性
ユーザー titan23titan23
提出日時 2022-09-30 22:01:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 972 bytes
コンパイル時間 2,439 ms
コンパイル使用メモリ 86,640 KB
実行使用メモリ 73,468 KB
最終ジャッジ日時 2023-08-24 15:33:29
合計ジャッジ時間 3,531 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
73,084 KB
testcase_01 AC 109 ms
73,200 KB
testcase_02 AC 109 ms
73,456 KB
testcase_03 AC 109 ms
73,288 KB
testcase_04 AC 110 ms
73,068 KB
testcase_05 AC 111 ms
73,176 KB
testcase_06 AC 110 ms
73,164 KB
testcase_07 AC 110 ms
73,196 KB
testcase_08 AC 110 ms
73,444 KB
testcase_09 AC 111 ms
73,140 KB
testcase_10 AC 117 ms
73,468 KB
testcase_11 AC 116 ms
72,932 KB
testcase_12 AC 118 ms
73,228 KB
testcase_13 AC 118 ms
73,300 KB
testcase_14 AC 111 ms
73,448 KB
testcase_15 AC 111 ms
73,104 KB
testcase_16 AC 112 ms
73,444 KB
testcase_17 AC 111 ms
73,336 KB
testcase_18 AC 111 ms
72,916 KB
testcase_19 AC 113 ms
73,320 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)

for i in range(1<<6):
  p = []
  for j in range(6):
    if (i >> j & 1):
      p.append(1)
    else:
      p.append(0)

  flag = True
  for v in dic.values():
    e = p[v[0]]
    for ele in v:
      if p[ele] != e:
        flag = False
        break
  if flag:
    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