結果

問題 No.792 真理関数をつくろう
ユーザー dangodango
提出日時 2023-06-22 18:58:24
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 465 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 273,480 KB
最終ジャッジ日時 2023-09-12 13:14:12
合計ジャッジ時間 7,624 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
75,916 KB
testcase_01 AC 105 ms
77,348 KB
testcase_02 AC 75 ms
71,304 KB
testcase_03 AC 133 ms
77,968 KB
testcase_04 AC 72 ms
71,112 KB
testcase_05 AC 129 ms
79,084 KB
testcase_06 AC 823 ms
259,960 KB
testcase_07 AC 83 ms
76,064 KB
testcase_08 AC 72 ms
71,528 KB
testcase_09 AC 74 ms
71,396 KB
testcase_10 AC 72 ms
71,560 KB
testcase_11 AC 72 ms
71,344 KB
testcase_12 AC 73 ms
71,200 KB
testcase_13 AC 73 ms
71,552 KB
testcase_14 AC 73 ms
71,376 KB
testcase_15 AC 75 ms
71,372 KB
testcase_16 AC 208 ms
81,876 KB
testcase_17 AC 73 ms
71,552 KB
testcase_18 AC 73 ms
71,352 KB
testcase_19 AC 73 ms
71,148 KB
testcase_20 AC 104 ms
77,700 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
cnt = 0
ans = ""
for _ in range(2 ** N):
    QR = list(map(int, input().split()))
    if QR[-1] == 0:
        continue
    cnt += 1
    if cnt > 1:
        ans += "∨"
    ans += "("
    for i in range(N):
        if i != 0:
            ans += "∧"
        if QR[:N][i] == 0:
            ans += "¬"
        ans += "P_" + str(i + 1)
    ans += ")"
if cnt == 0:
    print("A=⊥")
elif cnt == 2 ** N:
    print("A=⊤")
else:
    print("A=" + ans)
0