結果

問題 No.2090 否定論理積と充足可能性
ユーザー KudeKude
提出日時 2022-09-30 21:40:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 71,340 KB
最終ジャッジ日時 2023-08-24 15:04:23
合計ジャッジ時間 2,625 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,128 KB
testcase_01 AC 73 ms
71,096 KB
testcase_02 AC 72 ms
70,996 KB
testcase_03 AC 72 ms
71,156 KB
testcase_04 AC 72 ms
71,180 KB
testcase_05 AC 70 ms
71,024 KB
testcase_06 AC 72 ms
71,108 KB
testcase_07 AC 72 ms
71,096 KB
testcase_08 AC 72 ms
71,024 KB
testcase_09 AC 71 ms
71,180 KB
testcase_10 AC 70 ms
71,332 KB
testcase_11 AC 71 ms
71,224 KB
testcase_12 AC 71 ms
71,236 KB
testcase_13 AC 72 ms
71,340 KB
testcase_14 AC 71 ms
71,108 KB
testcase_15 AC 71 ms
71,200 KB
testcase_16 AC 70 ms
71,120 KB
testcase_17 AC 69 ms
71,100 KB
testcase_18 AC 71 ms
71,172 KB
testcase_19 AC 70 ms
71,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
a = list(map(int, input().split()))
d = {x: i for i, x in enumerate(set(a))}
for i in range(6):
    a[i] = d[a[i]]

def nand(x, y):
    return not (x and y)

for p in product(range(2), repeat=len(d)):
    if nand(nand(nand(p[a[0]], p[a[1]]), p[a[2]]), nand(nand(p[a[3]], p[a[4]]), p[a[5]])):
        print('YES')
        break
else:
    print('NO')
0