結果
| 問題 | 
                            No.792 真理関数をつくろう
                             | 
                    
| コンテスト | |
| ユーザー | 
                             rtia_iidx
                         | 
                    
| 提出日時 | 2019-02-22 21:57:23 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,816 bytes | 
| コンパイル時間 | 921 ms | 
| コンパイル使用メモリ | 108,064 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-11-25 08:12:11 | 
| 合計ジャッジ時間 | 1,715 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 4 | 
| other | WA * 22 | 
コンパイルメッセージ
main.cpp:82:29: warning: multi-character character constant [-Wmultichar]
   82 |                     cout << '¬';
      |                             ^~~
            
            ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>
#include<sstream>
using namespace std;
#define ll long long int
ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n;
    cin >> n;
    ll t = 1 << n;
    vector<vector<bool>> q(n,vector<bool>(t));
    vector<bool> r(t);
    for(int i = 0; i < t; i++){
        int tmp;
        for(int j = 0; j < n; j++){
            cin >> tmp;
            q[j][i] = (bool)tmp;
        }
        cin >> tmp;
        r[i] = (bool)tmp;
    }
    bool allt = true;
    bool allf = true;
    int c = 0;
    for(int i = 0; i < t; i++){
        if(r[i])c++;
        allt = allt && r[i];
        allf = allf && (!r[i]);
    }
    if(allt){
        cout << "A=竓、";
        return 0;
    }
    if(allf){
        cout << "A=竓・";
        return 0;
    }
    cout << "A=";
    
    bool flag = false;
    for(int i = 0; i < t; i++){
        if(r[i]){
            if(flag){
                cout << "∨";
            }
            if(c > 1){
                cout << "(";
            }
            for(int j = 0; j < n; j++){
                if(j > 0){
                    cout << "∧";
                }
                if(!q[j][i]){
                    cout << '¬';
                }
                cout << "P_";
                std::stringstream s;
                s << j+1;
                cout << s.str();
            }
            if(c > 1){
                cout << ")";
            }
            flag = true;
        }
    }
    cout <<endl;
    
    return 0;
}
            
            
            
        
            
rtia_iidx