結果

問題 No.792 真理関数をつくろう
ユーザー gorugo30gorugo30
提出日時 2021-02-24 20:03:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 531 bytes
コンパイル時間 390 ms
コンパイル使用メモリ 11,820 KB
実行使用メモリ 15,432 KB
最終ジャッジ日時 2023-10-25 01:12:34
合計ジャッジ時間 6,117 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
14,452 KB
testcase_01 AC 36 ms
10,180 KB
testcase_02 AC 30 ms
10,092 KB
testcase_03 AC 49 ms
10,240 KB
testcase_04 AC 29 ms
10,092 KB
testcase_05 AC 50 ms
10,240 KB
testcase_06 AC 1,311 ms
10,724 KB
testcase_07 AC 33 ms
10,140 KB
testcase_08 AC 30 ms
10,092 KB
testcase_09 AC 30 ms
10,092 KB
testcase_10 AC 30 ms
10,092 KB
testcase_11 AC 30 ms
10,092 KB
testcase_12 AC 29 ms
10,096 KB
testcase_13 AC 30 ms
10,092 KB
testcase_14 AC 29 ms
10,092 KB
testcase_15 AC 30 ms
10,112 KB
testcase_16 AC 175 ms
10,424 KB
testcase_17 AC 30 ms
10,104 KB
testcase_18 AC 29 ms
10,092 KB
testcase_19 AC 30 ms
10,092 KB
testcase_20 AC 48 ms
10,112 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