結果

問題 No.2090 否定論理積と充足可能性
ユーザー MasKoaTSMasKoaTS
提出日時 2022-09-30 21:59:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 1,346 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 71,564 KB
最終ジャッジ日時 2023-08-24 15:30:35
合計ジャッジ時間 3,895 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,264 KB
testcase_01 AC 71 ms
71,352 KB
testcase_02 AC 70 ms
71,132 KB
testcase_03 AC 71 ms
71,440 KB
testcase_04 AC 70 ms
71,472 KB
testcase_05 AC 71 ms
71,296 KB
testcase_06 AC 72 ms
71,440 KB
testcase_07 AC 72 ms
71,268 KB
testcase_08 AC 71 ms
71,408 KB
testcase_09 AC 72 ms
71,348 KB
testcase_10 AC 71 ms
71,224 KB
testcase_11 AC 71 ms
71,260 KB
testcase_12 AC 71 ms
71,020 KB
testcase_13 AC 71 ms
71,200 KB
testcase_14 AC 70 ms
71,088 KB
testcase_15 AC 71 ms
71,220 KB
testcase_16 AC 71 ms
71,216 KB
testcase_17 AC 72 ms
71,564 KB
testcase_18 AC 71 ms
71,464 KB
testcase_19 AC 70 ms
71,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def Nand(a, b):
	if(a == 1 and b == 1):
		return 0
	return 1

a = list(map(int, input().split()))
lis = sorted(set(a))
ans = False
for bit in range(1 << len(lis)):
	var = {}
	for i, k in enumerate(lis):
		var[k] = (bit >> i) & 1
	if(Nand(Nand(Nand(var[a[0]], var[a[1]]), var[a[2]]), Nand(Nand(var[a[3]], var[a[4]]), var[a[5]])) == 1):
		ans = True
		break

if(ans):
	print("YES")
else:
	print("NO")
0