結果

問題 No.792 真理関数をつくろう
ユーザー gorugo30gorugo30
提出日時 2021-02-24 20:03:30
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 531 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 81,656 KB
実行使用メモリ 268,528 KB
最終ジャッジ日時 2023-10-25 01:11:59
合計ジャッジ時間 6,856 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
57,764 KB
testcase_01 AC 96 ms
75,400 KB
testcase_02 AC 39 ms
53,416 KB
testcase_03 AC 113 ms
76,280 KB
testcase_04 AC 38 ms
53,416 KB
testcase_05 AC 107 ms
76,308 KB
testcase_06 AC 812 ms
258,672 KB
testcase_07 AC 53 ms
69,688 KB
testcase_08 AC 37 ms
53,416 KB
testcase_09 AC 39 ms
53,416 KB
testcase_10 AC 38 ms
53,416 KB
testcase_11 AC 38 ms
53,416 KB
testcase_12 AC 39 ms
53,416 KB
testcase_13 AC 39 ms
53,416 KB
testcase_14 AC 38 ms
53,416 KB
testcase_15 AC 42 ms
55,464 KB
testcase_16 AC 216 ms
80,224 KB
testcase_17 AC 38 ms
53,416 KB
testcase_18 AC 38 ms
53,416 KB
testcase_19 AC 38 ms
53,416 KB
testcase_20 AC 74 ms
75,888 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

cnt1 = 0
ans = "A="
katu = "∧"
mataha = "∨"
hitei = "¬"
for iiii in range(1 << N):
    QR = list(map(int, input().split()))
    R = QR[-1]
    if R == 0:
        continue
    Q = QR[:N]
    cnt1 += 1
    if cnt1 > 1:
        ans += mataha
    ans += "("
    for i in range(N):
        if i != 0:
            ans += katu
        if Q[i] == 0:
            ans += hitei
        ans += "P_" + str(i + 1)
    ans += ")"
if cnt1 == 0:
    print("A=⊥")
elif cnt1 == 1 << N:
    print("A=⊤")
else:
    print(ans)
0