結果
| 問題 |
No.792 真理関数をつくろう
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2020-02-23 03:07:24 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 884 bytes |
| コンパイル時間 | 690 ms |
| コンパイル使用メモリ | 64,956 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-10 01:24:22 |
| 合計ジャッジ時間 | 1,652 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 WA * 9 |
ソースコード
#include <iostream>
using namespace std;
const int mxn = 20;
int A[1<<mxn][mxn];
int B[mxn];
int main(){
int n;cin>>n;
int nya = 0;
for(int i = 0; (1<<n) > i; i++){
for(int j = 0; n > j; j++){
cin>>A[i][j];
}
cin>>B[i];
if(B[i])nya++;
}
cout << "A=";
if(!nya){
cout << "⊥";
}else if(nya == (1<<n)){
cout << "⊤";
}else{
bool fs = true;
for(int i = 0; (1<<n) > i; i++){
if(!B[i])continue;
if(fs){
fs = false;
}else{
cout << "∨";
}
cout << "(";
for(int j = 0; n > j; j++){
if(!A[i][j])cout << "¬";
cout << "P_" << j+1;
if(j+1 != n)cout << "∧";
}
cout << ")";
}
}
cout << endl;
}