結果

問題 No.2090 否定論理積と充足可能性
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-09-30 22:05:02
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 413 bytes
コンパイル時間 1,946 ms
コンパイル使用メモリ 86,756 KB
実行使用メモリ 71,732 KB
最終ジャッジ日時 2023-08-24 15:37:31
合計ジャッジ時間 4,735 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,668 KB
testcase_01 AC 90 ms
71,552 KB
testcase_02 AC 91 ms
71,408 KB
testcase_03 AC 91 ms
71,340 KB
testcase_04 AC 92 ms
71,336 KB
testcase_05 AC 91 ms
71,716 KB
testcase_06 AC 91 ms
71,556 KB
testcase_07 AC 91 ms
71,248 KB
testcase_08 AC 91 ms
71,420 KB
testcase_09 AC 90 ms
71,552 KB
testcase_10 AC 90 ms
71,488 KB
testcase_11 AC 91 ms
71,404 KB
testcase_12 AC 91 ms
71,400 KB
testcase_13 AC 92 ms
71,400 KB
testcase_14 AC 90 ms
71,552 KB
testcase_15 AC 95 ms
71,412 KB
testcase_16 AC 90 ms
71,472 KB
testcase_17 AC 90 ms
71,732 KB
testcase_18 AC 90 ms
71,688 KB
testcase_19 AC 90 ms
71,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def nand(a,b):
    return not (a & b)
p = list(map(int,input().split()))
n = len(set(p))
p2 = list(set(p))
from collections import defaultdict
import sys
for i in range(1 << n):
    d = defaultdict(int)
    for j in range(n):
        if (1 << j) & i:
            d[p2[j]] = 1
    if nand(nand(nand(d[p[0]],d[p[1]]),d[p[2]]),nand(nand(d[p[3]],d[p[4]]),d[p[5]])):
        sys.exit(print("YES"))
        
print("NO")
0