結果
問題 |
No.792 真理関数をつくろう
|
ユーザー |
|
提出日時 | 2020-06-25 12:49:35 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 69 ms / 2,000 ms |
コード長 | 336 bytes |
コンパイル時間 | 241 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 12,160 KB |
最終ジャッジ日時 | 2024-07-03 21:26:55 |
合計ジャッジ時間 | 2,196 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
#yuki792 n=int(input()) res=[] cnt=0 for i in range(2**n): f=input().split() if f[-1]=='1': cnt+=1 tmp=[] for j in range(n): if f[j]=='1': tmp+=['P_'+str(j+1)] else: tmp+=['¬P_'+ str(j+1)] res+=['('+'∧'.join(tmp)+')'] if cnt==0: res=['⊥'] elif cnt==2 ** n: res=['⊤'] print('A='+'∨'.join(res))