結果

問題 No.792 真理関数をつくろう
ユーザー rythem00359rythem00359
提出日時 2020-08-17 14:44:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 357 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 19,244 KB
最終ジャッジ日時 2024-04-19 18:53:04
合計ジャッジ時間 5,896 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
17,824 KB
testcase_01 AC 34 ms
10,880 KB
testcase_02 AC 28 ms
10,752 KB
testcase_03 AC 41 ms
11,008 KB
testcase_04 AC 25 ms
10,752 KB
testcase_05 AC 40 ms
11,008 KB
testcase_06 AC 1,037 ms
11,788 KB
testcase_07 AC 29 ms
10,880 KB
testcase_08 AC 27 ms
10,752 KB
testcase_09 AC 27 ms
10,752 KB
testcase_10 AC 26 ms
10,880 KB
testcase_11 AC 27 ms
10,752 KB
testcase_12 AC 26 ms
10,880 KB
testcase_13 AC 26 ms
10,752 KB
testcase_14 AC 25 ms
10,752 KB
testcase_15 AC 27 ms
10,880 KB
testcase_16 AC 152 ms
11,136 KB
testcase_17 AC 26 ms
10,752 KB
testcase_18 AC 25 ms
10,752 KB
testcase_19 AC 27 ms
10,752 KB
testcase_20 AC 49 ms
10,880 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
ans="A="
count=0
for i in range(2**N):
    a=[*map(int,input().split())]
    if a[-1]==1:
        count+=1
        ans+='('
        for j in range(1,N+1):
            if a[j-1]==0:
                ans+=('¬')
            ans+='P_'+str(j)+'∧'
        ans=ans[:-1]+')∨'
print(ans[:-1] if 0<count<2**N else 'A=⊥' if count==0 else 'A=⊤')
0