Advertisement
ivnikkk

Untitled

Mar 5th, 2022
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.58 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #define debug(l) cerr<<" smotri huinyi : "<<#l<<' '<<l<<'\n';
  3. #include "bits/stdc++.h"
  4. //#include "geometry.h"
  5. //#include "data_structure.h"
  6. using namespace std;
  7. using namespace chrono;
  8. #define all(cnt) cnt.begin(), cnt.end()
  9. #define allr(cnt) cnt.rbegin(), cnt.rend()
  10. #define sqrt(l) sqrtl(l)
  11. mt19937 rnd(std::chrono::high_resolution_clock::now().time_since_epoch().count());
  12. typedef long long ll;
  13. typedef long double ld;
  14. ll factor[20];
  15. signed main() {/*
  16. #ifdef _DEBUG
  17.     freopen("input.txt", "r", stdin);
  18.     freopen("output.txt", "w", stdout);
  19. #endif*/
  20.     ios_base::sync_with_stdio(false);
  21.     cin.tie(nullptr);
  22.     for (int i = 0; i < (1 << 5); i++) {
  23.         bitset<5> b;
  24.         b = i;
  25.         bool x1 = b[0], x2 = b[1], x3 = b[2], b1 = b[3], b2 = b[4];
  26.         bool g1 = x1 ^ x2;
  27.         bool g2 = g1 ^ x3;
  28.         bool g3 = g2 ^ b1;
  29.  
  30.         bool g4 = x1 & x2;
  31.         bool g5 = g1 & x3;
  32.         bool g6 = g2 & b1;
  33.  
  34.         bool g7 = b2 ^ g4;
  35.         bool g8 = g5 ^ g7;
  36.         bool g9 = g6 ^ g8;
  37.  
  38.         bool g10 = b2 & g4;
  39.         bool g11 = g5 & g7;
  40.         bool g12 = g6 & g8;
  41.  
  42.         bool g13 = g10 | g11 | g12;
  43.         bool g14 = g13 ^ g3;
  44.         bool g15 = g9 ^ (g13 & g3);
  45.  
  46.         if ((b[0] + b[1] + b[2] + b[3] + b[4] * 2) % 3 == (g14 + g15 * 2)%3) {
  47.             continue;
  48.         }
  49.         else {
  50.             cout << "WA" << endl;
  51.             cout << g14 << g15;
  52.             cout << endl;
  53.             cout << b[0] << ' ' << b[1]<<' ' << b[2] << ' ' << b[3] << ' ' << b[4] << endl << endl;
  54.         }
  55.     }
  56. }
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement