結果

問題 No.2090 否定論理積と充足可能性
ユーザー Akijin_007Akijin_007
提出日時 2022-09-30 22:21:31
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 71,304 KB
最終ジャッジ日時 2023-08-24 15:55:26
合計ジャッジ時間 2,687 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,156 KB
testcase_01 AC 73 ms
71,116 KB
testcase_02 AC 71 ms
70,936 KB
testcase_03 AC 73 ms
71,152 KB
testcase_04 AC 76 ms
71,236 KB
testcase_05 AC 73 ms
71,144 KB
testcase_06 AC 72 ms
71,084 KB
testcase_07 AC 72 ms
70,852 KB
testcase_08 AC 74 ms
71,304 KB
testcase_09 AC 72 ms
71,068 KB
testcase_10 AC 72 ms
70,956 KB
testcase_11 AC 73 ms
71,144 KB
testcase_12 AC 72 ms
71,120 KB
testcase_13 AC 73 ms
70,856 KB
testcase_14 AC 71 ms
70,960 KB
testcase_15 AC 71 ms
71,120 KB
testcase_16 AC 71 ms
71,252 KB
testcase_17 AC 70 ms
71,056 KB
testcase_18 AC 73 ms
70,992 KB
testcase_19 AC 72 ms
71,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

def NAND(a, b):
    return -(a & b) + 1

def f(x):
    return NAND(NAND(NAND(x[0], x[1]), x[2]), NAND(NAND(x[3], x[4]), x[5]))

A = list(input().split())

a = [0] * 6
for i in range(6):
    a[i] = A.index(A[i])

ans = 0

for i in range(1 << 6):
    b = format(i, "06b")
    u = [0] * 6
    for j in range(6):
        u[j] = int(b[a[j]])
    if f(u):
        ans = 1
        break

if ans == 1:
    print("YES")
else:
    print("NO")


0