結果
問題 | No.792 真理関数をつくろう |
ユーザー |
![]() |
提出日時 | 2019-05-09 16:06:24 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 500 bytes |
コンパイル時間 | 78 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 18,940 KB |
最終ジャッジ日時 | 2024-07-02 00:50:08 |
合計ジャッジ時間 | 5,798 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | AC * 21 TLE * 1 |
ソースコード
N = int(input())formula = "A="count = 0for i in range(2 ** N):lst = [int(x) for x in input().split()]if not lst[-1]:continuecount+=1if formula != "A=":formula+="∨"formula+="("for j in range(N):s = "P_" + str(j + 1)if not lst[j]:s = "¬" + sif j:s = "∧" + sformula+=sformula+=")"if formula == "A=":formula = "A=⊥"if count == 2 ** N:formula = "A=⊤"print(formula)