Advertisement
didedoshka

haha

Dec 6th, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <queue>
  5. #include <cmath>
  6. #include <set>
  7. #include <stack>
  8. #include <bitset>
  9. #include <map>
  10. #include <ctime>
  11. #include <numeric>
  12. #include <random>
  13.  
  14.  
  15. #ifndef M_PI
  16. #define M_PI 3.141592653589
  17. #endif
  18. #define int long long
  19. #define uint unsigned long long
  20. #define double long double
  21.  
  22. #ifdef TIME
  23. #define start cin.tie(NULL); cout.tie(NULL); cout.setf(ios::fixed); cout.precision(10); ios_base::sync_with_stdio(false);int32_t START = clock()
  24. #define finish cout << "\ntime: " << (clock() - START) / (CLOCKS_PER_SEC * 1.0); return 0
  25. #endif
  26.  
  27. #ifndef TIME
  28. #define start cin.tie(NULL); cout.tie(NULL); cout.setf(ios::fixed); cout.precision(10); ios_base::sync_with_stdio(false)
  29. #define finish return 0
  30. #endif
  31.  
  32. using namespace std;
  33.  
  34.  
  35. //vector input
  36. template<typename T>
  37. istream &operator>>(istream &is, vector<T> &vec) {
  38.     for (auto &i : vec) {
  39.         cin >> i;
  40.     }
  41.     return is;
  42. }
  43.  
  44. //pair output
  45. template<typename E>
  46. ostream &operator<<(ostream &os, pair<E, E> &t) {
  47.     os << t.first << ' ' << t.second;
  48.     return os;
  49. }
  50.  
  51. //"map" pair output
  52. template<typename E>
  53. ostream &operator<<(ostream &os, pair<const E, E> &t) {
  54.     os << t.first << ' ' << t.second;
  55.     return os;
  56. }
  57.  
  58. //vector output
  59. template<typename T>
  60. ostream &operator<<(ostream &os, vector<T> &vec) {
  61.     for (T i : vec) {
  62.         os << i << ' ';
  63.     }
  64.     return os;
  65. }
  66.  
  67. //2 dimensional vector output
  68. template<typename T>
  69. ostream &operator<<(ostream &os, vector<vector<T> > &vec) {
  70.     for (vector<T> i : vec) {
  71.         os << i << '\n';
  72.     }
  73.     return os;
  74. }
  75.  
  76. int32_t main() {
  77.     start;
  78.  
  79.     int a, b;
  80.     cin >> a >> b;
  81.     if (a == b) {
  82.         cout << 0 << '\n';
  83.         finish;
  84.     }
  85.     string ans1, ans2;
  86.     int aback = a;
  87.     int bback = b;
  88.  
  89.     vector<int> ab(2);
  90.     vector<int> abc{'a', 'b'};
  91.  
  92.     for (int first_place = 0; first_place < 2; ++first_place) {
  93.         for (int second_place = 0; second_place < 2; ++second_place) {
  94.             for (int third_place = 0; third_place < 2; ++third_place) {
  95.                 for (int fourth_place = 0; fourth_place < 2; ++fourth_place) {
  96.                     for (int fifth_place = 0; fifth_place < 2; ++fifth_place) {
  97.                         for (int sixth_place = 0; sixth_place < 2; ++sixth_place) {
  98.                             ab[0] = aback;
  99.                             ab[1] = bback;
  100.                             char op1, op2;
  101.                             for (int ops = 0; ops < 100; ++ops) {
  102.                                 if (ops / 10 == 0) {
  103.                                     op1 = '+';
  104.                                 }
  105.                                 if (ops / 10 == 1) {
  106.                                     op1 = '*';
  107.                                 }
  108.                                 if (ops / 10 == 2) {
  109.                                     op1 = '/';
  110.                                 }
  111.                                 if (ops / 10 == 3) {
  112.                                     op1 = '%';
  113.                                 }
  114.                                 if (ops / 10 == 4) {
  115.                                     op1 = '&';
  116.                                 }
  117.                                 if (ops / 10 == 5) {
  118.                                     op1 = '|';
  119.                                 }
  120.                                 if (ops / 10 == 6) {
  121.                                     op1 = '^';
  122.                                 }
  123.                                 if (ops / 10 == 7) {
  124.                                     op1 = '<';
  125.                                 }
  126.                                 if (ops / 10 == 8) {
  127.                                     op1 = '>';
  128.                                 }
  129.                                 if (ops % 10 == 0) {
  130.                                     op2 = '+';
  131.                                 }
  132.                                 if (ops % 10 == 1) {
  133.                                     op2 = '*';
  134.                                 }
  135.                                 if (ops % 10 == 2) {
  136.                                     op2 = '/';
  137.                                 }
  138.                                 if (ops % 10 == 3) {
  139.                                     op2 = '%';
  140.                                 }
  141.                                 if (ops % 10 == 4) {
  142.                                     op2 = '&';
  143.                                 }
  144.                                 if (ops % 10 == 5) {
  145.                                     op2 = '|';
  146.                                 }
  147.                                 if (ops % 10 == 6) {
  148.                                     op2 = '^';
  149.                                 }
  150.                                 if (ops % 10 == 7) {
  151.                                     op2 = '<';
  152.                                 }
  153.                                 if (ops % 10 == 8) {
  154.                                     op2 = '>';
  155.                                 }
  156.                                 if (op1 == '+') {
  157.                                     ab[first_place] = ab[second_place] + ab[third_place];
  158.                                     cout << ans1 << '\n';
  159.                                 }
  160.                                 if (op1 == '+') {
  161.                                     ab[first_place] = ab[second_place] + ab[third_place];
  162.                                 }
  163.                             }
  164.                         }
  165.                     }
  166.                 }
  167.             }
  168.         }
  169.     }
  170.    
  171.     cout << "3\na=a^b\nb=a^b\na=a^b\n";
  172.  
  173.     finish;
  174. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement