結果
| 問題 | No.792 真理関数をつくろう |
| コンテスト | |
| ユーザー |
iad_2889
|
| 提出日時 | 2019-05-09 16:06:24 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
TLE
不安定
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 500 bytes |
| 記録 | |
| コンパイル時間 | 65 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 11,568 KB |
| 最終ジャッジ日時 | 2026-11-13 17:45:46 |
| 合計ジャッジ時間 | 7,496 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 TLE * 1 |
ソースコード
N = int(input())
formula = "A="
count = 0
for i in range(2 ** N):
lst = [int(x) for x in input().split()]
if not lst[-1]:
continue
count+=1
if formula != "A=":
formula+="∨"
formula+="("
for j in range(N):
s = "P_" + str(j + 1)
if not lst[j]:
s = "¬" + s
if j:
s = "∧" + s
formula+=s
formula+=")"
if formula == "A=":
formula = "A=⊥"
if count == 2 ** N:
formula = "A=⊤"
print(formula)
iad_2889