結果

問題 No.792 真理関数をつくろう
ユーザー TAISA_TAISA_
提出日時 2019-02-22 21:34:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,121 bytes
コンパイル時間 1,975 ms
コンパイル使用メモリ 175,672 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 01:53:49
合計ジャッジ時間 2,684 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
5,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:25:51: warning: multi-character character constant [-Wmultichar]
   25 |                         if(c[i][j]==0)t.push_back('¬');
      |                                                   ^~~
main.cpp:30:37: warning: multi-character character constant [-Wmultichar]
   30 |                         t.push_back('∧');
      |                                     ^~~
main.cpp: In function 'int main()':
main.cpp:25:51: warning: overflow in conversion from 'int' to 'char' changes value from '49836' to ''\37777777654'' [-Woverflow]
   25 |                         if(c[i][j]==0)t.push_back('¬');
      |                                                   ^~~
main.cpp:30:37: warning: overflow in conversion from 'int' to 'char' changes value from '14846119' to ''\37777777647'' [-Woverflow]
   30 |                         t.push_back('∧');
      |                                     ^~~

ソースコード

diff #

#include <bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
#define mp make_pair
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
const ll INF=1LL<<30;
const ll LINF=1LL<<62;
const double eps=1e-9;
const ll MOD=1000000007LL;
template<typename T>void chmin(T &a,T b){a=min(a,b);};
template<typename T>void chmax(T &a,T b){a=max(a,b);};
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int main(){
	int n;cin>>n;
	vector<vector<int>> c(1<<n,vector<int>(n));
	vector<int> r(1<<n);
	bool f1=true,f2=true;
	vector<string> s;
	for(int i=0;i<(1<<n);i++){
		string t="(";
		for(int j=0;j<n;j++){
			cin>>c[i][j];
			if(c[i][j]==0)t.push_back('¬');
			t.push_back('P');
			t.push_back('_');
			if(j+1>=10)t.push_back('1');
			t.push_back('0'+(j+1)%10);
			t.push_back('∧');			
		}
		t.pop_back();
		t.push_back(')');
		cin>>r[i];
		if(r[i]==0)f1=false;
		if(r[i]==1){
			f2=false;
			s.push_back(t);
		}
	}
	if(f1){
		cout<<"A=⊤"<<endl;
		return 0;
	}
	if(f2){
		cout<<"A=⊥"<<endl;
		return 0;
	}
	cout<<"A=";
	for(int i=0;i<s.size();i++){
		cout<<s[i];
		if(i<s.size()-1){
			cout<<"∨";
		}
	}
	cout<<endl;
}
0