Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <set>
- #include <string>
- #include <algorithm>
- using namespace std;
- using ll = long long;
- void cv(vector <int> v){
- for (auto x: v) cout<<x<<' ';
- cout<<'\n';
- }
- bool f(bool A, bool B, bool C){
- bool a,b,c;
- //a = A || !B || !C;
- //b = A || B || !C;
- //return a&&b;
- return A || !C;
- }
- bool ch(bool A, bool B, bool C){
- bool r = 0;
- bool cmp;
- if (A xor B == 1){
- cmp = !B || !C;
- if (f(A,B,C) == cmp){
- r = 1;
- }
- }
- else if (A xor C == 1){
- cmp = !C || A && B;
- if (f(A,B,C) == cmp){
- r = 1;
- }
- }
- else if (B xor C == 0){
- cmp = A || !B;
- if (f(A,B,C) == cmp){
- r = 1;
- }
- }
- return r;
- }
- int main()
- {
- vector <bool> cn = {false, true};
- bool r = 1;
- for (bool a: cn){
- if (!r) break;
- for (bool b: cn){
- if (!r) break;
- for (bool c: cn){
- if (!ch(a,b,c)){
- r = 0;
- cout<<a<<' '<<b<<' '<<c<<'\n';
- cout<<"f= "<<f(a,b,c)<<'\n';
- break;
- }
- }
- }
- }
- cout<<"res= "<<r<<'\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement