結果
| 問題 | No.792 真理関数をつくろう | 
| コンテスト | |
| ユーザー |  Bantako | 
| 提出日時 | 2019-04-09 16:59:47 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                TLE
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 461 bytes | 
| コンパイル時間 | 288 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 19,060 KB | 
| 最終ジャッジ日時 | 2024-07-04 02:20:05 | 
| 合計ジャッジ時間 | 5,681 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 4 | 
| other | AC * 21 TLE * 1 | 
ソースコード
N = int(input())
ans = "A="
cnt = 0
for i in range(2**N):
    l =  list(map(int,input().split()))
    if l[-1] == 0:
        continue
    cnt += 1
    if ans != "A=":
        ans += "∨"
    ans += "("
    for j in range(N):
        s = "P_" + str(j + 1)
        if l[j] == 0:
            s = "¬" + s
        if j != 0:
            s = "∧" + s
        ans += s
    ans += ")"
if ans == "A=":
    ans = "A=⊥"
if cnt == 2**N:
    ans = "A=⊤"
print(ans)
            
            
            
        