結果

問題 No.792 真理関数をつくろう
ユーザー vwxyzvwxyz
提出日時 2024-04-07 09:15:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-04-07 09:15:17
合計ジャッジ時間 1,987 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
9,856 KB
testcase_01 AC 31 ms
9,984 KB
testcase_02 AC 27 ms
9,856 KB
testcase_03 AC 36 ms
10,112 KB
testcase_04 AC 28 ms
9,856 KB
testcase_05 AC 35 ms
10,112 KB
testcase_06 AC 65 ms
10,880 KB
testcase_07 AC 29 ms
9,984 KB
testcase_08 AC 27 ms
9,856 KB
testcase_09 AC 27 ms
9,856 KB
testcase_10 AC 27 ms
9,856 KB
testcase_11 AC 28 ms
9,856 KB
testcase_12 AC 28 ms
9,856 KB
testcase_13 AC 27 ms
9,856 KB
testcase_14 AC 27 ms
9,856 KB
testcase_15 AC 28 ms
9,984 KB
testcase_16 AC 47 ms
10,368 KB
testcase_17 AC 28 ms
9,856 KB
testcase_18 AC 28 ms
9,856 KB
testcase_19 AC 27 ms
9,856 KB
testcase_20 AC 47 ms
9,984 KB
testcase_21 AC 83 ms
11,648 KB
testcase_22 AC 27 ms
9,856 KB
testcase_23 AC 28 ms
9,856 KB
testcase_24 AC 29 ms
9,856 KB
testcase_25 AC 28 ms
9,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ans_lst=[]
N=int(input())
for i in range(1<<N):
    *Q,R=map(int,input().split())
    ans=[]
    if not R:
        continue
    for i,q in enumerate(Q,1):
        s=""
        if not q:
            s+="¬"
        s+="P_"
        s+=str(i)
        ans.append(s)
    ans_lst.append("("+"∧".join(ans)+")")
if len(ans_lst)==0:
    print("A=⊥")
elif len(ans_lst)==1<<N:
    print("A=⊤")
else:
    print("A="+"∨".join(ans_lst))
0