結果

問題 No.792 真理関数をつくろう
ユーザー MisterMister
提出日時 2020-04-10 18:50:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 798 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 9,172 KB
最終ジャッジ日時 2023-10-13 11:15:01
合計ジャッジ時間 2,066 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,936 KB
testcase_01 AC 17 ms
8,280 KB
testcase_02 AC 14 ms
7,900 KB
testcase_03 AC 20 ms
8,400 KB
testcase_04 AC 14 ms
7,840 KB
testcase_05 AC 19 ms
8,332 KB
testcase_06 AC 40 ms
8,696 KB
testcase_07 AC 15 ms
7,776 KB
testcase_08 AC 16 ms
7,800 KB
testcase_09 AC 15 ms
7,800 KB
testcase_10 AC 14 ms
7,784 KB
testcase_11 AC 14 ms
7,980 KB
testcase_12 AC 14 ms
7,852 KB
testcase_13 AC 15 ms
7,844 KB
testcase_14 AC 17 ms
7,852 KB
testcase_15 AC 17 ms
7,824 KB
testcase_16 AC 29 ms
8,364 KB
testcase_17 AC 15 ms
7,852 KB
testcase_18 AC 14 ms
7,840 KB
testcase_19 AC 16 ms
7,780 KB
testcase_20 AC 31 ms
7,940 KB
testcase_21 AC 53 ms
9,172 KB
testcase_22 AC 13 ms
7,916 KB
testcase_23 AC 14 ms
7,880 KB
testcase_24 AC 14 ms
7,808 KB
testcase_25 AC 14 ms
7,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

cnot = chr(172)
cand = chr(8743)
cor = chr(8744)
ctop = chr(8868)
cbot = chr(8869)


def main():
    n = int(input())

    all = True
    ans = ""

    for _ in range(2 ** n):
        v = list(map(int, input().split()))
        if v[-1] == 0:
            all = False
            continue

        ans += "A=" if len(ans) == 0 else cor

        ans += "("

        for i in range(n):
            if i != 0:
                ans += cand
            if v[i] == 0:
                ans += cnot
            ans += "P_"
            ans += str(i + 1)

        ans += ")"

    if len(ans) == 0:
        ans = "A=" + cbot

    if all:
        ans = "A=" + ctop

    print(ans)


def checkord():
    s = input()
    for c in s:
        print(c, ord(c))


if __name__ == "__main__":
    # checkord()
    main()
0