結果
| 問題 | No.792 真理関数をつくろう |
| コンテスト | |
| ユーザー |
rythem00359
|
| 提出日時 | 2020-08-17 14:44:39 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 1,555 ms / 2,000 ms |
| コード長 | 357 bytes |
| 記録 | |
| コンパイル時間 | 722 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 16,900 KB |
| 最終ジャッジ日時 | 2026-04-27 18:15:34 |
| 合計ジャッジ時間 | 6,027 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 |
ソースコード
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=⊤')
rythem00359