結果
| 問題 |
No.792 真理関数をつくろう
|
| コンテスト | |
| ユーザー |
TAISA_
|
| 提出日時 | 2019-02-22 21:34:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,121 bytes |
| コンパイル時間 | 1,735 ms |
| コンパイル使用メモリ | 177,376 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-25 07:44:59 |
| 合計ジャッジ時間 | 2,689 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 1 WA * 21 |
コンパイルメッセージ
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('∧');
| ^~~
ソースコード
#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;
}
TAISA_