#include <ctime>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
template <class Type>
class BIT {
private:
size_t size_; Type *v;
inline Type sum(size_t r) { Type ret = 0; while (r > 0) ret += v[r], r -= r & (-r); return ret; }
public:
BIT() {};
BIT(size_t size__) {
for (size_ = 1; size_ < size__;) size_ <<= 1;
v = (Type *)malloc(sizeof(Type) * (size_ + 1));
for (size_t i = 0; i <= size_; i++) v[i] = 0;
}
inline void add(size_t i, Type x) { i++; while (i <= size_) v[i] += x, i += i & -i; }
inline Type sum(size_t l, size_t r) { return sum(r) - sum(l); }
bool operator[](size_t x) { return sum(x, x + 1); }
};
template <class Type>
class BIT2 {
private:
size_t size_; vector<Type> v;
Type sum(size_t r) { Type ret = 0; while (r > 0) ret += v[r], r -= r & (-r); return ret; }
public:
BIT2() {};
BIT2(size_t size__) {
for (size_ = 1; size_ < size__;) size_ <<= 1;
v.resize(size_ + 1, 0);
}
inline void add(size_t i, Type x) { i++; while (i <= size_) v[i] += x, i += i & -i; }
inline Type sum(size_t l, size_t r) { return sum(r) - sum(l); }
bool operator[](size_t x) { return sum(x, x + 1); }
};
int main() {
srand((unsigned)time(NULL));
int a, b;
scanf("%d%d", &a, &b);
BIT<int> x(1 << 15);
for (int i = 0; i < (1 << 25); i++) {
int k = i & 32767;
x.add(k ^ 23233, k ^ 9548);
int l = k ^ 15496, r = k ^ 2544;
if (l > r) swap(l, r);
x.sum(l, r + 1);
}
printf("%d\n", a - b);
//cout << clock() - t << endl;
return 0;
}
./Main.cpp: In function ‘int main()’:
./Main.cpp:40:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &a, &b);
^