結果

問題 No.792 真理関数をつくろう
ユーザー htkbhtkb
提出日時 2019-02-22 21:39:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 9,848 KB
最終ジャッジ日時 2023-08-16 18:20:44
合計ジャッジ時間 1,459 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,952 KB
testcase_01 AC 15 ms
8,348 KB
testcase_02 AC 13 ms
7,984 KB
testcase_03 AC 16 ms
8,392 KB
testcase_04 AC 13 ms
7,860 KB
testcase_05 AC 16 ms
8,336 KB
testcase_06 AC 27 ms
8,976 KB
testcase_07 AC 14 ms
7,840 KB
testcase_08 AC 12 ms
7,868 KB
testcase_09 AC 13 ms
7,804 KB
testcase_10 AC 12 ms
7,840 KB
testcase_11 AC 13 ms
7,800 KB
testcase_12 AC 12 ms
7,820 KB
testcase_13 AC 13 ms
7,904 KB
testcase_14 AC 13 ms
7,900 KB
testcase_15 AC 13 ms
7,888 KB
testcase_16 AC 20 ms
8,712 KB
testcase_17 AC 13 ms
7,808 KB
testcase_18 AC 13 ms
7,980 KB
testcase_19 AC 12 ms
7,764 KB
testcase_20 AC 22 ms
7,836 KB
testcase_21 AC 33 ms
9,848 KB
testcase_22 AC 13 ms
7,764 KB
testcase_23 AC 13 ms
7,932 KB
testcase_24 AC 13 ms
7,860 KB
testcase_25 AC 12 ms
7,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
N = int(input())
p = [("¬P_%d"%i, "P_%d"%i)for i in range(1, N+1)]
ans = []

for a in (list(map(int, l.split())) for l in sys.stdin):
    if a[-1] == 0:
        continue
    s = "∧".join(p[i][n] for i, n in enumerate(a[:-1]))
    ans.append("(%s)"%s)

print("A="+("⊤" if len(ans)==2**N else "⊥" if not ans else "∨".join(ans)))
0