結果

問題 No.792 真理関数をつくろう
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2019-02-24 19:32:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 530 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 13,648 KB
最終ジャッジ日時 2023-08-25 01:41:08
合計ジャッジ時間 6,005 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
12,212 KB
testcase_01 AC 21 ms
8,284 KB
testcase_02 AC 14 ms
7,820 KB
testcase_03 AC 34 ms
8,408 KB
testcase_04 AC 14 ms
7,812 KB
testcase_05 AC 32 ms
8,256 KB
testcase_06 AC 1,198 ms
8,816 KB
testcase_07 AC 16 ms
7,944 KB
testcase_08 AC 14 ms
7,808 KB
testcase_09 AC 15 ms
7,920 KB
testcase_10 AC 15 ms
7,812 KB
testcase_11 AC 14 ms
7,828 KB
testcase_12 AC 14 ms
7,820 KB
testcase_13 AC 14 ms
7,800 KB
testcase_14 AC 14 ms
7,916 KB
testcase_15 AC 16 ms
7,888 KB
testcase_16 AC 154 ms
8,572 KB
testcase_17 AC 15 ms
7,796 KB
testcase_18 AC 14 ms
7,816 KB
testcase_19 AC 14 ms
7,912 KB
testcase_20 AC 31 ms
7,844 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

flg = False
ans = ""

for _ in range(2 ** n):
    tmp = [int(x) for x in input().split()]
    q = tmp[:-1]
    r = tmp[-1]
    if r == 1:
        if ans != "":
            ans += "∨"
        ans += "("
        for j, v in enumerate(q):
            if j != 0:
                ans += "∧"
            if v == 0:
                ans += "¬"
            ans += "P_" + str(j + 1)
        ans += ")"
    else:
        flg = True

if ans == "":
    ans = "⊥"
elif not flg:
    ans = "⊤"
print("A=", ans, sep="")
0