結果

問題 No.792 真理関数をつくろう
ユーザー ssmkzkssmkzk
提出日時 2020-07-07 15:49:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 492 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 18,132 KB
最終ジャッジ日時 2024-04-08 16:22:52
合計ジャッジ時間 5,588 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
9,984 KB
testcase_01 AC 37 ms
10,112 KB
testcase_02 AC 32 ms
9,984 KB
testcase_03 AC 49 ms
10,240 KB
testcase_04 AC 34 ms
9,984 KB
testcase_05 AC 46 ms
10,240 KB
testcase_06 AC 802 ms
10,864 KB
testcase_07 AC 32 ms
10,112 KB
testcase_08 AC 30 ms
9,984 KB
testcase_09 AC 31 ms
9,984 KB
testcase_10 AC 30 ms
9,984 KB
testcase_11 AC 31 ms
9,984 KB
testcase_12 AC 30 ms
10,112 KB
testcase_13 AC 30 ms
9,984 KB
testcase_14 AC 30 ms
9,984 KB
testcase_15 AC 31 ms
10,112 KB
testcase_16 AC 119 ms
10,368 KB
testcase_17 AC 30 ms
10,112 KB
testcase_18 AC 31 ms
9,984 KB
testcase_19 AC 31 ms
9,984 KB
testcase_20 AC 49 ms
10,112 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
count = 0

line = 2 ** N
ans = ""
for i in range(line):
    l = list(map(int, input().split()))
    if l[-1] == 1:
        ans += "("
        for j in range(N):
            if l[j] == 1:
                ans += "P_" + str(j + 1) + "∧"
            else:
                ans += "¬P_" + str(j + 1) + "∧"
        ans = ans[:-1]
        ans += ")∨"
        count += 1

if count == 0:
    print("A=⊥")
elif count == line:
    print("A=⊤")
else:
    print("A=" + ans[:-1])
0