Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <queue>
- #include <cmath>
- #include <set>
- #include <stack>
- #include <bitset>
- #include <map>
- #include <ctime>
- #include <numeric>
- #include <random>
- #ifndef M_PI
- #define M_PI 3.141592653589
- #endif
- #define int long long
- #define uint unsigned long long
- #define double long double
- #ifdef TIME
- #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()
- #define finish cout << "\ntime: " << (clock() - START) / (CLOCKS_PER_SEC * 1.0); return 0
- #endif
- #ifndef TIME
- #define start cin.tie(NULL); cout.tie(NULL); cout.setf(ios::fixed); cout.precision(10); ios_base::sync_with_stdio(false)
- #define finish return 0
- #endif
- using namespace std;
- //vector input
- template<typename T>
- istream &operator>>(istream &is, vector<T> &vec) {
- for (auto &i : vec) {
- cin >> i;
- }
- return is;
- }
- //pair output
- template<typename E>
- ostream &operator<<(ostream &os, pair<E, E> &t) {
- os << t.first << ' ' << t.second;
- return os;
- }
- //"map" pair output
- template<typename E>
- ostream &operator<<(ostream &os, pair<const E, E> &t) {
- os << t.first << ' ' << t.second;
- return os;
- }
- //vector output
- template<typename T>
- ostream &operator<<(ostream &os, vector<T> &vec) {
- for (T i : vec) {
- os << i << ' ';
- }
- return os;
- }
- //2 dimensional vector output
- template<typename T>
- ostream &operator<<(ostream &os, vector<vector<T> > &vec) {
- for (vector<T> i : vec) {
- os << i << '\n';
- }
- return os;
- }
- int32_t main() {
- start;
- int a, b;
- cin >> a >> b;
- if (a == b) {
- cout << 0 << '\n';
- finish;
- }
- string ans1, ans2;
- int aback = a;
- int bback = b;
- vector<int> ab(2);
- vector<int> abc{'a', 'b'};
- for (int first_place = 0; first_place < 2; ++first_place) {
- for (int second_place = 0; second_place < 2; ++second_place) {
- for (int third_place = 0; third_place < 2; ++third_place) {
- for (int fourth_place = 0; fourth_place < 2; ++fourth_place) {
- for (int fifth_place = 0; fifth_place < 2; ++fifth_place) {
- for (int sixth_place = 0; sixth_place < 2; ++sixth_place) {
- ab[0] = aback;
- ab[1] = bback;
- char op1, op2;
- for (int ops = 0; ops < 100; ++ops) {
- if (ops / 10 == 0) {
- op1 = '+';
- }
- if (ops / 10 == 1) {
- op1 = '*';
- }
- if (ops / 10 == 2) {
- op1 = '/';
- }
- if (ops / 10 == 3) {
- op1 = '%';
- }
- if (ops / 10 == 4) {
- op1 = '&';
- }
- if (ops / 10 == 5) {
- op1 = '|';
- }
- if (ops / 10 == 6) {
- op1 = '^';
- }
- if (ops / 10 == 7) {
- op1 = '<';
- }
- if (ops / 10 == 8) {
- op1 = '>';
- }
- if (ops % 10 == 0) {
- op2 = '+';
- }
- if (ops % 10 == 1) {
- op2 = '*';
- }
- if (ops % 10 == 2) {
- op2 = '/';
- }
- if (ops % 10 == 3) {
- op2 = '%';
- }
- if (ops % 10 == 4) {
- op2 = '&';
- }
- if (ops % 10 == 5) {
- op2 = '|';
- }
- if (ops % 10 == 6) {
- op2 = '^';
- }
- if (ops % 10 == 7) {
- op2 = '<';
- }
- if (ops % 10 == 8) {
- op2 = '>';
- }
- if (op1 == '+') {
- ab[first_place] = ab[second_place] + ab[third_place];
- cout << ans1 << '\n';
- }
- if (op1 == '+') {
- ab[first_place] = ab[second_place] + ab[third_place];
- }
- }
- }
- }
- }
- }
- }
- }
- cout << "3\na=a^b\nb=a^b\na=a^b\n";
- finish;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement