結果
問題 | No.2090 否定論理積と充足可能性 |
ユーザー |
|
提出日時 | 2022-09-30 22:01:31 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 49 ms / 2,000 ms |
コード長 | 972 bytes |
コンパイル時間 | 700 ms |
コンパイル使用メモリ | 81,800 KB |
実行使用メモリ | 56,148 KB |
最終ジャッジ日時 | 2024-12-22 23:41:38 |
合計ジャッジ時間 | 2,280 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
'''input'''import sysimport mathfrom bisect import bisect_right, bisect_leftfrom itertools import *from collections import *from heapq import heapify, heappush, heappopimport randominf = float('inf')# mod = 1000000007# mod = 998244353input = 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 = Truefor v in dic.values():e = p[v[0]]for ele in v:if p[ele] != e:flag = Falsebreakif 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')