結果
| 問題 | No.792 真理関数をつくろう |
| コンテスト | |
| ユーザー |
ei1333333
|
| 提出日時 | 2019-02-22 21:25:15 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 702 bytes |
| 記録 | |
| コンパイル時間 | 2,083 ms |
| コンパイル使用メモリ | 193,756 KB |
| 最終ジャッジ日時 | 2025-01-06 21:35:33 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
int main() {
int N, Q[1 << 12][12];
cin >> N;
cout << "A=";
bool ok = false;
for(int i = 0; i < 1 << N; i++) {
int bit[12];
for(int j = 0; j < N; j++) {
cin >> bit[j];
}
int k;
cin >> k;
if(k == 1) {
if(ok) cout << "∨";
ok = true;
cout << "(";
for(int j = 0; j < N; j++) {
if(j > 0) {
cout << "∧";
}
if(bit[j] == 0) {
cout << "¬P_" << j + 1;
} else {
cout << "P_" << j + 1;
}
}
cout << ")";
}
}
if(!ok) {
cout << "⊥" << endl;
} else {
cout << endl;
}
}
ei1333333