結果
問題 |
No.2090 否定論理積と充足可能性
|
ユーザー |
|
提出日時 | 2022-09-30 21:36:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 56 ms / 2,000 ms |
コード長 | 545 bytes |
コンパイル時間 | 332 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 61,056 KB |
最終ジャッジ日時 | 2024-12-22 22:41:00 |
合計ジャッジ時間 | 2,390 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
import sys input = sys.stdin.readline from collections import * def nand(x, y): return 1^(x&y) def f(l): return nand(nand(nand(l[0], l[1]), l[2]), nand(nand(l[3], l[4]), l[5])) == 1 A = list(input().split()) for S in range(1<<6): l = [] for i in range(6): l.append((S>>i)&1) ok = True for i in range(6): for j in range(6): if A[i]==A[j] and l[i]!=l[j]: ok = False if not ok: continue if f(l): exit(print('YES')) print('NO')