結果

問題 No.792 真理関数をつくろう
ユーザー gorugo30gorugo30
提出日時 2021-02-24 20:02:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 532 bytes
コンパイル時間 1,835 ms
コンパイル使用メモリ 81,448 KB
実行使用メモリ 271,396 KB
最終ジャッジ日時 2023-10-25 01:11:31
合計ジャッジ時間 6,868 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 37 ms
53,388 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
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