結果

問題 No.792 真理関数をつくろう
ユーザー ei1333333ei1333333
提出日時 2019-02-22 21:25:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 702 bytes
コンパイル時間 1,725 ms
コンパイル使用メモリ 200,424 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-04 01:52:14
合計ジャッジ時間 2,501 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 3 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 4 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 4 ms
6,944 KB
testcase_06 AC 14 ms
6,940 KB
testcase_07 AC 3 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 8 ms
6,940 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 1 ms
6,944 KB
testcase_20 AC 9 ms
6,944 KB
testcase_21 AC 19 ms
6,944 KB
testcase_22 AC 1 ms
6,940 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 WA -
testcase_25 AC 2 ms
6,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
  }


}
0