Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "testlib.h"
- #include <vector>
- #include <algorithm>
- #include <iostream>
- #include <queue>
- #include <map>
- #include <cassert>
- #include <cstdio>
- #include <string>
- #include <time.h>
- #include <iomanip>
- #include <cmath>
- #include <stack>
- #include <set>
- using namespace std;
- const int INF = 1e9;
- const int MAXLEN = 62;
- vector<int> toBin(long long x)
- {
- vector<int> result;
- while (x)
- {
- result.push_back(x % 2);
- x /= 2;
- }
- reverse(result.begin(), result.end());
- return result;
- }
- void solve(int argc, char* argv[])
- {
- registerValidation(argc, argv);
- long long a = inf.readLong(0, 1000000000000000000LL, "a");
- inf.readSpace();
- long long b = inf.readLong(0, 1000000000000000000LL, "b");
- inf.readEoln();
- vector<int> A = toBin(a);
- vector<int> B = toBin(b);
- ensuref(A.size() + B.size() <= MAXLEN, "Too large expecting answer");
- inf.readEof();
- }
- int main(int argc, char* argv[])
- {
- #ifdef _DEBUG
- freopen("input.txt", "r", stdin);
- #endif
- //srand(time(NULL));
- solve(argc, argv);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement