Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <queue>
- #include <algorithm>
- #include <string>
- #include <stack>
- #include <set>
- #include <map>
- #define pii pair <int, int>
- #define pb(x) push_back(x)
- using namespace std;
- using ll = long long;
- using ld = long double;
- using db = double;
- void cv(vector <int> &v) {
- for (auto x : v) cout << x << ' ';
- cout << "\n";
- }
- void cvl(vector <ll> &v) {
- for (auto x : v) cout << x << ' ';
- cout << "\n";
- }
- void cvv(vector <vector <int> > &v) {
- for (auto x : v) cv(x);
- cout << "\n";
- }
- void cvb(vector <bool> v) {
- for (bool x : v) cout << x << ' ';
- cout << "\n";
- }
- void cvs(vector <string> v) {
- for (auto a : v) {
- cout << a << "\n";
- }
- }
- void cvp(vector <pii> a) {
- for (auto p : a) {
- cout << p.first << ' ' << p.second << "\n";
- }
- cout << "\n";
- }
- /*
- 11011101111111010000000011111101
- */
- string to(int x) {
- string r = "";
- while (x > 0) {
- r += x % 2 + '0';
- x /= 2;
- }
- while (r.size() < 5) r += '0';
- reverse(r.begin(), r.end());
- return r;
- }
- bool g(bool a, bool b, bool c, bool d, bool e) {
- return !a && !d || !a && e || b && !c || b && !d || b && e;
- }
- bool h(bool a, bool b, bool c, bool d, bool e) {
- return (!a || b) && (!d || e) || b && !c;
- }
- int main() {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- string s = "10111111000000001011111110111011";
- string me;
- reverse(s.begin(), s.end());
- cout << s << "\n";
- for (int i = 0; i < 32; ++i) {
- string t = to(i);
- cout << t << ' ' << s[i] << "\n";
- bool a, b, c, d, e;
- a = t[0] - '0';
- b = t[1] - '0';
- c = t[2] - '0';
- d = t[3] - '0';
- e = t[4] - '0';
- me += h(a, b, c, d, e) + '0';
- }
- cout << s << "\n";
- cout << me << "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement