QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#285072 | #7932. AND-OR closure | ucup-team180# | AC ✓ | 170ms | 20432kb | C++20 | 36.0kb | 2023-12-16 16:26:04 | 2023-12-16 16:26:05 |
Judging History
answer
#pragma region Macros
#ifdef noimi
#include "my_template.hpp"
#else
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <immintrin.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfenv>
#include <cfloat>
#include <chrono>
#include <cinttypes>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdarg>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <immintrin.h>
#include <initializer_list>
#include <iomanip>
#include <ios>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <streambuf>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <variant>
#ifdef noimi
#define oj_local(a, b) b
#else
#define oj_local(a, b) a
#endif
#define LOCAL if(oj_local(0, 1))
#define OJ if(oj_local(1, 0))
using namespace std;
using ll = long long;
using ull = unsigned long long int;
using i128 = __int128_t;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ld = long double;
template <typename T> using vc = vector<T>;
template <typename T> using vvc = vector<vc<T>>;
template <typename T> using vvvc = vector<vvc<T>>;
using vi = vc<int>;
using vl = vc<ll>;
using vpi = vc<pii>;
using vpl = vc<pll>;
template <class T> using pq = priority_queue<T>;
template <class T> using pqg = priority_queue<T, vector<T>, greater<T>>;
template <typename T> int si(const T &x) { return x.size(); }
template <class T, class S> inline bool chmax(T &a, const S &b) { return (a < b ? a = b, 1 : 0); }
template <class T, class S> inline bool chmin(T &a, const S &b) { return (a > b ? a = b, 1 : 0); }
vi iota(int n) {
vi a(n);
return iota(a.begin(), a.end(), 0), a;
}
template <typename T> vi iota(const vector<T> &a, bool greater = false) {
vi res(a.size());
iota(res.begin(), res.end(), 0);
sort(res.begin(), res.end(), [&](int i, int j) {
if(greater) return a[i] > a[j];
return a[i] < a[j];
});
return res;
}
// macros
#define overload5(a, b, c, d, e, name, ...) name
#define overload4(a, b, c, d, name, ...) name
#define endl '\n'
#define REP0(n) for(ll jidlsjf = 0; jidlsjf < n; ++jidlsjf)
#define REP1(i, n) for(ll i = 0; i < (n); ++i)
#define REP2(i, a, b) for(ll i = (a); i < (b); ++i)
#define REP3(i, a, b, c) for(ll i = (a); i < (b); i += (c))
#define rep(...) overload4(__VA_ARGS__, REP3, REP2, REP1, REP0)(__VA_ARGS__)
#define per0(n) for(int jidlsjf = 0; jidlsjf < (n); ++jidlsjf)
#define per1(i, n) for(ll i = (n)-1; i >= 0; --i)
#define per2(i, a, b) for(ll i = (a)-1; i >= b; --i)
#define per3(i, a, b, c) for(ll i = (a)-1; i >= (b); i -= (c))
#define per(...) overload4(__VA_ARGS__, per3, per2, per1, per0)(__VA_ARGS__)
#define fore0(a) rep(a.size())
#define fore1(i, a) for(auto &&i : a)
#define fore2(a, b, v) for(auto &&[a, b] : v)
#define fore3(a, b, c, v) for(auto &&[a, b, c] : v)
#define fore4(a, b, c, d, v) for(auto &&[a, b, c, d] : v)
#define fore(...) overload5(__VA_ARGS__, fore4, fore3, fore2, fore1, fore0)(__VA_ARGS__)
#define setbits(j, n) for(ll iiiii = (n), j = lowbit(iiiii); iiiii; iiiii ^= 1 << j, j = lowbit(iiiii))
#define perm(v) for(bool permrepflag = true; (permrepflag ? exchange(permrepflag, false) : next_permutation(all(v)));)
#define fi first
#define se second
#define pb push_back
#define ppb pop_back
#define ppf pop_front
#define eb emplace_back
#define drop(s) cout << #s << endl, exit(0)
#define si(c) (int)(c).size()
#define lb(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define lbg(c, x) distance((c).begin(), lower_bound(all(c), (x), greater{}))
#define ub(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define ubg(c, x) distance((c).begin(), upper_bound(all(c), (x), greater{}))
#define rng(v, l, r) v.begin() + (l), v.begin() + (r)
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define SORT(v) sort(all(v))
#define REV(v) reverse(all(v))
#define UNIQUE(x) SORT(x), x.erase(unique(all(x)), x.end())
template <typename T = ll, typename S> T SUM(const S &v) { return accumulate(all(v), T(0)); }
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define overload2(_1, _2, name, ...) name
#define vec(type, name, ...) vector<type> name(__VA_ARGS__)
#define vv(type, name, h, ...) vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) vector<vector<vector<type>>> name(h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...) \
vector<vector<vector<vector<type>>>> name(a, vector<vector<vector<type>>>(b, vector<vector<type>>(c, vector<type>(__VA_ARGS__))))
constexpr pii dx4[4] = {pii{1, 0}, pii{0, 1}, pii{-1, 0}, pii{0, -1}};
constexpr pii dx8[8] = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};
namespace yesno_impl {
const string YESNO[2] = {"NO", "YES"};
const string YesNo[2] = {"No", "Yes"};
const string yesno[2] = {"no", "yes"};
const string firstsecond[2] = {"second", "first"};
const string FirstSecond[2] = {"Second", "First"};
const string possiblestr[2] = {"impossible", "possible"};
const string Possiblestr[2] = {"Impossible", "Possible"};
void YES(bool t = 1) { cout << YESNO[t] << endl; }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { cout << YesNo[t] << endl; }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { cout << yesno[t] << endl; }
void no(bool t = 1) { yes(!t); }
void first(bool t = 1) { cout << firstsecond[t] << endl; }
void First(bool t = 1) { cout << FirstSecond[t] << endl; }
void possible(bool t = 1) { cout << possiblestr[t] << endl; }
void Possible(bool t = 1) { cout << Possiblestr[t] << endl; }
}; // namespace yesno_impl
using namespace yesno_impl;
#define INT(...) \
int __VA_ARGS__; \
IN(__VA_ARGS__)
#define INTd(...) \
int __VA_ARGS__; \
IN2(__VA_ARGS__)
#define LL(...) \
ll __VA_ARGS__; \
IN(__VA_ARGS__)
#define LLd(...) \
ll __VA_ARGS__; \
IN2(__VA_ARGS__)
#define STR(...) \
string __VA_ARGS__; \
IN(__VA_ARGS__)
#define CHR(...) \
char __VA_ARGS__; \
IN(__VA_ARGS__)
#define DBL(...) \
double __VA_ARGS__; \
IN(__VA_ARGS__)
#define VEC(type, name, size) \
vector<type> name(size); \
IN(name)
#define VECd(type, name, size) \
vector<type> name(size); \
IN2(name)
#define VEC2(type, name1, name2, size) \
vector<type> name1(size), name2(size); \
for(int i = 0; i < size; i++) IN(name1[i], name2[i])
#define VEC2d(type, name1, name2, size) \
vector<type> name1(size), name2(size); \
for(int i = 0; i < size; i++) IN2(name1[i], name2[i])
#define VEC3(type, name1, name2, name3, size) \
vector<type> name1(size), name2(size), name3(size); \
for(int i = 0; i < size; i++) IN(name1[i], name2[i], name3[i])
#define VEC3d(type, name1, name2, name3, size) \
vector<type> name1(size), name2(size), name3(size); \
for(int i = 0; i < size; i++) IN2(name1[i], name2[i], name3[i])
#define VEC4(type, name1, name2, name3, name4, size) \
vector<type> name1(size), name2(size), name3(size), name4(size); \
for(int i = 0; i < size; i++) IN(name1[i], name2[i], name3[i], name4[i]);
#define VEC4d(type, name1, name2, name3, name4, size) \
vector<type> name1(size), name2(size), name3(size), name4(size); \
for(int i = 0; i < size; i++) IN2(name1[i], name2[i], name3[i], name4[i]);
#define VV(type, name, h, w) \
vector<vector<type>> name(h, vector<type>(w)); \
IN(name)
#define VVd(type, name, h, w) \
vector<vector<type>> name(h, vector<type>(w)); \
IN2(name)
int scan() { return getchar(); }
void scan(int &a) { cin >> a; }
void scan(long long &a) { cin >> a; }
void scan(char &a) { cin >> a; }
void scan(double &a) { cin >> a; }
void scan(string &a) { cin >> a; }
template <class T, class S> void scan(pair<T, S> &p) { scan(p.first), scan(p.second); }
template <class T> void scan(vector<T> &);
template <class T> void scan(vector<T> &a) {
for(auto &i : a) scan(i);
}
template <class T> void scan(T &a) { cin >> a; }
void IN() {}
void IN2() {}
template <class Head, class... Tail> void IN(Head &head, Tail &...tail) {
scan(head);
IN(tail...);
}
template <class Head, class... Tail> void IN2(Head &head, Tail &...tail) {
scan(head);
--head;
IN2(tail...);
}
template <int p = -1> void pat() {}
template <int p = -1, class Head, class... Tail> void pat(Head &h, Tail &...tail) {
h += p;
pat<p>(tail...);
}
template <typename T, typename S> T ceil(T x, S y) {
assert(y);
return (y < 0 ? ceil(-x, -y) : (x > 0 ? (x + y - 1) / y : x / y));
}
template <typename T, typename S> T floor(T x, S y) {
assert(y);
return (y < 0 ? floor(-x, -y) : (x > 0 ? x / y : x / y - (x % y == 0 ? 0 : 1)));
}
template <typename T, typename S, typename U> U bigmul(const T &x, const S &y, const U &lim) { // clamp(x * y, -lim, lim)
if(x < 0 and y < 0) return bigmul(-x, -y, lim);
if(x < 0) return -bigmul(-x, y, lim);
if(y < 0) return -bigmul(x, -y, lim);
return y == 0 or x <= lim / y ? x * y : lim;
}
template <class T> T POW(T x, int n) {
T res = 1;
for(; n; n >>= 1, x *= x)
if(n & 1) res *= x;
return res;
}
template <class T, class S> T POW(T x, S n, const ll &mod) {
T res = 1;
x %= mod;
for(; n; n >>= 1, x = x * x % mod)
if(n & 1) res = res * x % mod;
return res;
}
vector<pll> factor(ll x) {
vector<pll> ans;
for(ll i = 2; i * i <= x; i++)
if(x % i == 0) {
ans.push_back({i, 1});
while((x /= i) % i == 0) ans.back().second++;
}
if(x != 1) ans.push_back({x, 1});
return ans;
}
template <class T> vector<T> divisor(T x) {
vector<T> ans;
for(T i = 1; i * i <= x; i++)
if(x % i == 0) {
ans.pb(i);
if(i * i != x) ans.pb(x / i);
}
return ans;
}
template <typename T> void zip(vector<T> &x) {
vector<T> y = x;
UNIQUE(y);
for(int i = 0; i < x.size(); ++i) { x[i] = lb(y, x[i]); }
}
template <class S> void fold_in(vector<S> &v) {}
template <typename Head, typename... Tail, class S> void fold_in(vector<S> &v, Head &&a, Tail &&...tail) {
for(auto e : a) v.emplace_back(e);
fold_in(v, tail...);
}
template <class S> void renumber(vector<S> &v) {}
template <typename Head, typename... Tail, class S> void renumber(vector<S> &v, Head &&a, Tail &&...tail) {
for(auto &&e : a) e = lb(v, e);
renumber(v, tail...);
}
template <class S, class... Args> vector<S> zip(vector<S> &head, Args &&...args) {
vector<S> v;
fold_in(v, head, args...);
sort(all(v)), v.erase(unique(all(v)), v.end());
renumber(v, head, args...);
return v;
}
template <typename S> void rearrange(const vector<S> &id) {}
template <typename S, typename T> void rearrange_exec(const vector<S> &id, vector<T> &v) {
vector<T> w(v.size());
rep(i, si(id)) w[i] = v[id[i]];
v.swap(w);
}
// 並び替える順番, 並び替える vector 達
template <typename S, typename Head, typename... Tail> void rearrange(const vector<S> &id, Head &a, Tail &...tail) {
rearrange_exec(id, a);
rearrange(id, tail...);
}
template <typename T> vector<T> RUI(const vector<T> &v) {
vector<T> res(v.size() + 1);
for(int i = 0; i < v.size(); i++) res[i + 1] = res[i] + v[i];
return res;
}
template <typename T> void zeta_supersetsum(vector<T> &f) {
int n = f.size();
for(int i = 1; i < n; i <<= 1) rep(b, n) if(!(i & b)) f[b] += f[b | i];
}
template <typename T> void zeta_subsetsum(vector<T> &f) {
int n = f.size();
for(int i = 1; i < n; i <<= 1) rep(b, n) if(!(i & b)) f[b | i] += f[b];
}
template <typename T> void mobius_subset(vector<T> &f) {
int n = f.size();
for(int i = 1; i < n; i <<= 1) rep(b, n) if(!(i & b)) f[b] -= f[b | i];
}
template <typename T> void mobius_superset(vector<T> &f) {
int n = f.size();
for(int i = 1; i < n; i <<= 1) rep(b, n) if(!(i & b)) f[b | i] -= f[b];
}
// 反時計周りに 90 度回転
template <typename T> void rot(vector<vector<T>> &v) {
if(empty(v)) return;
int n = v.size(), m = v[0].size();
vector<vector<T>> res(m, vector<T>(n));
rep(i, n) rep(j, m) res[m - 1 - j][i] = v[i][j];
v.swap(res);
}
vector<int> counter(const vector<int> &v, int max_num = -1) {
if(max_num == -1) max_num = MAX(v);
vector<int> res(max_num + 1);
fore(e, v) res[e]++;
return res;
}
// x in [l, r)
template <class T, class S> bool inc(const T &x, const S &l, const S &r) { return l <= x and x < r; }
template <class T, class S> bool inc(const T &x, const pair<S, S> &p) { return p.first <= x and x < p.second; }
// 便利関数
constexpr ll ten(int n) { return n == 0 ? 1 : ten(n - 1) * 10; }
constexpr ll tri(ll n) { return n * (n + 1) / 2; }
// l + ... + r
constexpr ll tri(ll l, ll r) { return (l + r) * (r - l + 1) / 2; }
ll max(int x, ll y) { return max((ll)x, y); }
ll max(ll x, int y) { return max(x, (ll)y); }
int min(int x, ll y) { return min((ll)x, y); }
int min(ll x, int y) { return min(x, (ll)y); }
// bit 演算系
#define bit(i) (1LL << i) // (1 << i)
#define test(b, i) (b >> i & 1) // b の i bit 目が立っているか
ll pow2(int i) { return 1LL << i; }
int topbit(signed t) { return t == 0 ? -1 : 31 - __builtin_clz(t); }
int topbit(ll t) { return t == 0 ? -1 : 63 - __builtin_clzll(t); }
int lowbit(signed a) { return a == 0 ? 32 : __builtin_ctz(a); }
int lowbit(ll a) { return a == 0 ? 64 : __builtin_ctzll(a); }
// int allbit(int n) { return (1 << n) - 1; }
constexpr ll mask(int n) { return (1LL << n) - 1; }
// int popcount(signed t) { return __builtin_popcount(t); }
// int popcount(ll t) { return __builtin_popcountll(t); }
int popcount(uint64_t t) { return __builtin_popcountll(t); }
static inline uint64_t popcount64(uint64_t x) {
uint64_t m1 = 0x5555555555555555ll;
uint64_t m2 = 0x3333333333333333ll;
uint64_t m4 = 0x0F0F0F0F0F0F0F0Fll;
uint64_t h01 = 0x0101010101010101ll;
x -= (x >> 1) & m1;
x = (x & m2) + ((x >> 2) & m2);
x = (x + (x >> 4)) & m4;
return (x * h01) >> 56;
}
bool ispow2(int i) { return i && (i & -i) == i; }
ll rnd(ll l, ll r) { //[l, r)
#ifdef noimi
static mt19937_64 gen;
#else
static mt19937_64 gen(chrono::steady_clock::now().time_since_epoch().count());
#endif
return uniform_int_distribution<ll>(l, r - 1)(gen);
}
ll rnd(ll n) { return rnd(0, n); }
template <class t> void random_shuffle(vc<t> &a) { rep(i, si(a)) swap(a[i], a[rnd(0, i + 1)]); }
int in() {
int x;
cin >> x;
return x;
}
ll lin() {
unsigned long long x;
cin >> x;
return x;
}
template <class T, class S> pair<T, S> operator-(const pair<T, S> &x) { return pair<T, S>(-x.first, -x.second); }
template <class T, class S> pair<T, S> operator-(const pair<T, S> &x, const pair<T, S> &y) { return pair<T, S>(x.fi - y.fi, x.se - y.se); }
template <class T, class S> pair<T, S> operator+(const pair<T, S> &x, const pair<T, S> &y) { return pair<T, S>(x.fi + y.fi, x.se + y.se); }
template <class T> pair<T, T> operator&(const pair<T, T> &l, const pair<T, T> &r) { return pair<T, T>(max(l.fi, r.fi), min(l.se, r.se)); }
template <class T, class S> pair<T, S> operator+=(pair<T, S> &l, const pair<T, S> &r) { return l = l + r; }
template <class T, class S> pair<T, S> operator-=(pair<T, S> &l, const pair<T, S> &r) { return l = l - r; }
template <class T> bool intersect(const pair<T, T> &l, const pair<T, T> &r) { return (l.se < r.se ? r.fi < l.se : l.fi < r.se); }
template <class T> vector<T> &operator++(vector<T> &v) {
fore(e, v) e++;
return v;
}
template <class T> vector<T> operator++(vector<T> &v, int) {
auto res = v;
fore(e, v) e++;
return res;
}
template <class T> vector<T> &operator--(vector<T> &v) {
fore(e, v) e--;
return v;
}
template <class T> vector<T> operator--(vector<T> &v, int) {
auto res = v;
fore(e, v) e--;
return res;
}
template <class T> void connect(vector<T> &l, const vector<T> &r) { fore(e, r) l.eb(e); }
template <class T> vector<T> operator+(const vector<T> &l, const vector<T> &r) {
vector<T> res(max(si(l), si(r)));
rep(i, si(l)) res[i] += l[i];
rep(i, si(r)) res[i] += r[i];
return res;
}
template <class T> vector<T> operator-(const vector<T> &l, const vector<T> &r) {
vector<T> res(max(si(l), si(r)));
rep(i, si(l)) res[i] += l[i];
rep(i, si(r)) res[i] -= r[i];
return res;
}
template <class T> vector<T> &operator+=(const vector<T> &l, const vector<T> &r) {
if(si(l) < si(r)) l.resize(si(r));
rep(i, si(r)) l[i] += r[i];
return l;
}
template <class T> vector<T> &operator-=(const vector<T> &l, const vector<T> &r) {
if(si(l) < si(r)) l.resize(si(r));
rep(i, si(r)) l[i] -= r[i];
return l;
}
template <class T> vector<T> &operator+=(vector<T> &v, const T &x) {
fore(e, v) e += x;
return v;
}
template <class T> vector<T> &operator-=(vector<T> &v, const T &x) {
fore(e, v) e -= x;
return v;
}
template <typename T> struct edge {
int from, to;
T cost;
int id;
edge(int to, T cost) : from(-1), to(to), cost(cost) {}
edge(int from, int to, T cost) : from(from), to(to), cost(cost) {}
edge(int from, int to, T cost, int id) : from(from), to(to), cost(cost), id(id) {}
constexpr bool operator<(const edge<T> &rhs) const noexcept { return cost < rhs.cost; }
edge &operator=(const int &x) {
to = x;
return *this;
}
operator int() const { return to; }
friend ostream operator<<(ostream &os, const edge &e) { return os << e.to; }
};
template <typename T> using Edges = vector<edge<T>>;
template <typename T = int> Edges<T> read_edges(int m, bool weighted = false) {
Edges<T> res;
res.reserve(m);
for(int i = 0; i < m; i++) {
int u, v, c = 0;
scan(u), scan(v), u--, v--;
if(weighted) scan(c);
res.eb(u, v, c, i);
}
return res;
}
using Tree = vector<vector<int>>;
using Graph = vector<vector<int>>;
template <class T> using Wgraph = vector<vector<edge<T>>>;
Graph getG(int n, int m = -1, bool directed = false, int margin = 1) {
Tree res(n);
if(m == -1) m = n - 1;
while(m--) {
int a, b;
cin >> a >> b;
a -= margin, b -= margin;
res[a].emplace_back(b);
if(!directed) res[b].emplace_back(a);
}
return res;
}
Graph getTreeFromPar(int n, int margin = 1) {
Graph res(n);
for(int i = 1; i < n; i++) {
int a;
cin >> a;
res[a - margin].emplace_back(i);
}
return res;
}
template <class T> Wgraph<T> getWg(int n, int m = -1, bool directed = false, int margin = 1) {
Wgraph<T> res(n);
if(m == -1) m = n - 1;
while(m--) {
int a, b;
T c;
scan(a), scan(b), scan(c);
a -= margin, b -= margin;
res[a].emplace_back(b, c);
if(!directed) res[b].emplace_back(a, c);
}
return res;
}
void add(Graph &G, int x, int y) { G[x].eb(y), G[y].eb(x); }
template <class S, class T> void add(Wgraph<S> &G, int x, int y, T c) { G[x].eb(y, c), G[y].eb(x, c); }
#define TEST \
INT(testcases); \
while(testcases--)
i128 abs(const i128 &x) { return x > 0 ? x : -x; }
istream &operator>>(istream &is, i128 &v) {
string s;
is >> s;
v = 0;
for(int i = 0; i < (int)s.size(); i++) {
if(isdigit(s[i])) { v = v * 10 + s[i] - '0'; }
}
if(s[0] == '-') { v *= -1; }
return is;
}
ostream &operator<<(ostream &os, const i128 &v) {
if(v == 0) { return (os << "0"); }
i128 num = v;
if(v < 0) {
os << '-';
num = -num;
}
string s;
for(; num > 0; num /= 10) { s.push_back((char)(num % 10) + '0'); }
reverse(s.begin(), s.end());
return (os << s);
}
namespace aux {
template <typename T, unsigned N, unsigned L> struct tp {
static void output(std::ostream &os, const T &v) {
os << std::get<N>(v) << (&os == &cerr ? ", " : " ");
tp<T, N + 1, L>::output(os, v);
}
};
template <typename T, unsigned N> struct tp<T, N, N> {
static void output(std::ostream &os, const T &v) { os << std::get<N>(v); }
};
} // namespace aux
template <typename... Ts> std::ostream &operator<<(std::ostream &os, const std::tuple<Ts...> &t) {
if(&os == &cerr) { os << '('; }
aux::tp<std::tuple<Ts...>, 0, sizeof...(Ts) - 1>::output(os, t);
if(&os == &cerr) { os << ')'; }
return os;
}
template <typename T, typename S, typename U> std::ostream &operator<<(std::ostream &os, const priority_queue<T, S, U> &_pq) {
auto pq = _pq;
vector<T> res;
while(!empty(pq)) res.emplace_back(pq.top()), pq.pop();
return os << res;
}
template <class T, class S> ostream &operator<<(ostream &os, const pair<T, S> &p) {
if(&os == &cerr) { return os << "(" << p.first << ", " << p.second << ")"; }
return os << p.first << " " << p.second;
}
template <class Ch, class Tr, class Container> std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, const Container &x) {
bool f = true;
if(&os == &cerr) os << "[";
for(auto &y : x) {
if(&os == &cerr)
os << (f ? "" : ", ") << y;
else
os << (f ? "" : " ") << y;
f = false;
}
if(&os == &cerr) os << "]";
return os;
}
#define dump(...) static_cast<void>(0)
#define dbg(...) static_cast<void>(0)
void OUT() { cout << endl; }
template <class Head, class... Tail> void OUT(const Head &head, const Tail &...tail) {
cout << head;
if(sizeof...(tail)) cout << ' ';
OUT(tail...);
}
template <typename T> static constexpr T inf = numeric_limits<T>::max() / 2;
template <class T, class S> constexpr pair<T, S> inf<pair<T, S>> = {inf<T>, inf<S>};
template <class T> void OUT2(const T &t, T INF = inf<T>, T res = -1) { OUT(t != INF ? t : res); }
template <class T> void OUT2(vector<T> &v, T INF = inf<T>, T res = -1) {
fore(e, v) if(e == INF) e = res;
OUT(v);
fore(e, v) if(e == res) e = INF;
}
template <class F> struct REC {
F f;
REC(F &&f_) : f(forward<F>(f_)) {}
template <class... Args> auto operator()(Args &&...args) const { return f(*this, forward<Args>(args)...); }
};
template <class S> vector<pair<S, int>> runLength(const vector<S> &v) {
vector<pair<S, int>> res;
for(auto &e : v) {
if(res.empty() or res.back().fi != e)
res.eb(e, 1);
else
res.back().se++;
}
return res;
}
vector<pair<char, int>> runLength(const string &v) {
vector<pair<char, int>> res;
for(auto &e : v) {
if(res.empty() or res.back().fi != e)
res.eb(e, 1);
else
res.back().se++;
}
return res;
}
struct string_converter {
char start = 0;
char type(const char &c) const { return (islower(c) ? 'a' : isupper(c) ? 'A' : isdigit(c) ? '0' : 0); }
int convert(const char &c) {
if(!start) start = type(c);
return c - start;
}
int convert(const char &c, const string &chars) { return chars.find(c); }
template <typename T> auto convert(const T &v) {
vector<decltype(convert(v[0]))> ret;
ret.reserve(size(v));
for(auto &&e : v) ret.emplace_back(convert(e));
return ret;
}
template <typename T> auto convert(const T &v, const string &chars) {
vector<decltype(convert(v[0], chars))> ret;
ret.reserve(size(v));
for(auto &&e : v) ret.emplace_back(convert(e, chars));
return ret;
}
int operator()(const char &v, char s = 0) {
start = s;
return convert(v);
}
int operator()(const char &v, const string &chars) { return convert(v, chars); }
template <typename T> auto operator()(const T &v, char s = 0) {
start = s;
return convert(v);
}
template <typename T> auto operator()(const T &v, const string &chars) { return convert(v, chars); }
} toint;
template <class T, class F> T bin_search(T ok, T ng, const F &f) {
while(abs(ok - ng) > 1) {
T mid = ok + ng >> 1;
(f(mid) ? ok : ng) = mid;
}
return ok;
}
template <class T, class F> T bin_search_double(T ok, T ng, const F &f, int iter = 80) {
while(iter--) {
// T mid = (ok + ng) / 2;
T mid = sqrtl(ok * ng);
(f(mid) ? ok : ng) = mid;
}
return ok;
}
struct Setup_io {
Setup_io() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cout << fixed << setprecision(11);
}
} setup_io;
#endif
#pragma endregion
struct SCC {
private:
template <typename T, bool Cond = is_void<T>::value> struct E;
template <typename T> struct E<T, false> {
int to;
T cost;
E() {}
E(const int &v, const T &c) : to(v), cost(c) {}
operator int() const { return to; }
};
template <typename T> struct E<T, true> {
int to;
E() {}
E(const int &v) : to(v) {}
operator int() const { return to; }
};
template <typename T = void> struct StaticGraph {
private:
template <typename It> struct Es {
It b, e;
It begin() const { return b; }
It end() const { return e; }
int size() const { return int(e - b); }
auto &&operator[](int i) const { return b[i]; }
};
int N, M, ec;
vector<int> head;
vector<pair<int, E<T>>> buf;
vector<E<T>> es;
void build() {
partial_sum(begin(head), end(head), begin(head));
es.resize(M);
for(auto &&[u, e] : buf) es[--head[u]] = e;
}
public:
StaticGraph(int _n, int _m) : N(_n), M(_m), ec(0), head(N + 1, 0) { buf.reserve(M); }
template <typename... Args> void add_edge(int u, Args &&...args) {
#pragma GCC diagnostic ignored "-Wnarrowing"
buf.emplace_back(u, E<T>{std::forward<Args>(args)...});
#pragma GCC diagnostic warning "-Wnarrowing"
++head[u];
if((int)buf.size() == M) build();
}
Es<typename vector<E<T>>::iterator> operator[](int u) { return {begin(es) + head[u], begin(es) + head[u + 1]}; }
const Es<typename vector<E<T>>::const_iterator> operator[](int u) const { return {begin(es) + head[u], begin(es) + head[u + 1]}; }
int size() const { return N; }
};
public:
int n;
vector<pair<int, int>> edges;
vector<int> comp;
int num; // 強連結成分の数
template <typename G> SCC(const G &g) : n(g.size()), comp(g.size()), num(0) {
int M = 0;
for(auto &&e : g) M += e.size();
edges.reserve(M);
for(int i = 0; i < n; i++)
for(auto &&e : g[i]) edges.emplace_back(i, e);
build();
};
SCC(int n, int m = 0) : n(n), comp(n, -1), num(0) { edges.reserve(m); };
inline void add(int a, int b) { edges.emplace_back(a, b); }
const int operator[](int k) const { return comp[k]; }
void build() {
StaticGraph<void> g(n, edges.size());
for(auto &&[u, v] : edges) g.add_edge(u, v);
vector<int> ord(n, -1), low(n), visit(n), node_idx(n), par(n, -1);
int now = 0, vi = 0;
for(int x = 0; x < n; x++) {
if(ord[x] == -1) {
int tmp = x;
while(tmp >= 0) {
if(!node_idx[tmp]) low[tmp] = ord[tmp] = now++, visit[vi++] = tmp;
if(node_idx[tmp] == g[tmp].size()) {
if(low[tmp] == ord[tmp]) {
while(true) {
int u = visit[--vi];
ord[u] = n, comp[u] = num;
if(u == tmp) break;
}
num++;
}
if(par[tmp] < 0) break;
low[par[tmp]] = min(low[par[tmp]], low[tmp]);
tmp = par[tmp];
} else {
int nxt = g[tmp][node_idx[tmp]++];
if(ord[nxt] == -1) {
par[nxt] = exchange(tmp, nxt);
} else {
low[tmp] = min(low[tmp], ord[nxt]);
}
}
}
}
}
for(auto &&e : comp) { e = num - 1 - e; }
}
// 強連結成分を潰した DAG を返す
Graph getGraph() {
Graph res(num);
for(auto &&[u, v] : edges) {
if(comp[u] != comp[v]) res[comp[u]].emplace_back(comp[v]);
}
vector<int> mem(n);
rep(i, num) {
rep(j, si(res[i])) {
if(mem[res[i][j]]++) {
swap(res[i][j], res[i].back());
res[i].pop_back();
j--;
}
}
fore(e, res[i]) mem[e] = 0;
}
return res;
}
// 強連結成分ごとに属する頂点を返す
vector<vector<int>> belong() {
vector<vector<int>> res(num);
rep(i, n) res[comp[i]].emplace_back(i);
return res;
}
};
int main() {
INT(n);
VEC(ll, a, n);
int M = 40;
vi nouse(M);
rep(i, M) {
int c = 0;
fore(e, a) { c += test(e, i); }
if(c == 0 or c == n) nouse[i] = true;
}
fore(e, a) {
ll nxt = 0;
int j = 0;
rep(i, M) {
if(!nouse[i] and test(e, i)) nxt += bit(j);
if(!nouse[i]) j++;
}
e = nxt;
}
dump(a);
M -= SUM(nouse);
Graph g(M);
dump(nouse, M);
rep(t, M) {
ll now = -1;
fore(e, a) {
if(test(e, t)) {
if(now == -1) now = e;
now &= e;
}
}
rep(i, M) {
if(i == t) continue;
if(test(now, i)) g[i].eb(t);
}
dump(t, now);
}
dump(g);
SCC scc(g);
g = scc.getGraph();
dump(g);
n = si(g);
vl ng(n);
rep(i, n) {
vi used(n);
REC([&](auto &&f, int x) -> void {
used[x] = true;
if(x != i) ng[i] |= bit(x), ng[x] |= bit(i);
fore(e, g[x]) {
if(!used[e]) f(e);
}
})
(i);
}
dump(ng);
auto get = REC([&](auto &&f, int l, int r) -> vl {
vl res(1 << r - l);
rep(b, 1 << r - l) {
bool flag = true;
rep(i, r - l) {
if(test(b, i) and ng[i + l] & (b << l)) {
flag = false;
break;
}
}
if(flag) res[b] = 1;
}
return res;
});
auto L = get(0, n / 2), R = get(n / 2, n);
dump(L, R);
zeta_subsetsum(R);
ll ans = 0;
rep(i, si(L)) {
if(!L[i]) continue;
ll ok = mask(n - n / 2);
rep(t, n / 2) if(test(i, t)) { ok &= ~(ng[t] >> n / 2); }
ans += R[ok];
}
OUT(ans);
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3576kb
input:
4 0 1 3 5
output:
5
result:
ok 1 number(s): "5"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
5 0 1 2 3 4
output:
8
result:
ok 1 number(s): "8"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
49 1097363587067 1096810445814 275012137504 1096739142630 1096809921522 1087071335264 829364908576 949625500192 1087142638448 1096200190829 1097292808175 1095750860656 1087144145776 1097346808827 1095734082416 1096755396578 829230678048 1095663303524 1087072842592 1096216444777 949623992864 10962714...
output:
52
result:
ok 1 number(s): "52"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3888kb
input:
40 32 830045728951 278250692646 1021660937663 881584025918 275993636902 275953000615 327534555567 329833558447 278293950631 327534558639 893011227647 327533244718 1021660934591 1021661000703 893011161535 1030787822591 832344731831 275994947751 1073741862 329832247598 278292639782 1030787825663 10307...
output:
44
result:
ok 1 number(s): "44"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
113 995010353355 513836652779 438679050443 548477566959 507675377387 412904849600 412904919234 431506823898 1065151889147 436774574666 413152182848 438955900619 412871032896 436497750090 24159262794 419628520130 479476914639 427941630147 436493424714 412875358272 541196352 1098370744303 445117176011...
output:
143
result:
ok 1 number(s): "143"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
63 274873712607 183352984580 549655082623 549688637311 463755584628 188974231516 463789156220 183487485535 274873708508 183487464532 463789160319 188907059039 463755605631 137709486080 463822782207 181339965016 274840153820 187799217236 187799238239 463789139316 146970789464 549722255100 18897421461...
output:
63
result:
ok 1 number(s): "63"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
46 343736386052 77314129940 1099444493311 1094075521919 68724195332 353165185622 541926877791 490604139103 404722784854 1099444493023 1094142655359 410091756246 547530709727 1094142655071 352863191638 525047822943 524980689503 524678695519 547597843167 541859744639 1099511626463 507483193951 3875417...
output:
46
result:
ok 1 number(s): "46"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
49 73358378052 349495737422 73358394852 74617839076 349496261711 74433224164 74616757732 377952403438 349494672878 74618363365 74432142820 74156382272 352180764143 352180223054 77302324708 74432126020 1045287271919 377952927727 360772271598 74617822276 77302848997 1039379725807 1074829312 3494946560...
output:
49
result:
ok 1 number(s): "49"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
55 1097313795995 1065134439323 77916805395 1028593268635 305549054739 305549054720 301254054675 1099511627775 376450620179 1030774306715 375750245147 305951707931 304942973696 302332064531 304945074944 308132746011 306627064576 9196278016 13491278099 377931283227 374672235291 307730092819 3066270645...
output:
59
result:
ok 1 number(s): "59"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
140 618955644536 618880146008 618956693368 206638591281 618954923376 618881194840 619835332946 624338984050 405244424 73492646960 628566235994 210935738169 69122164752 652800941950 632935669370 550158506048 770376204155 623249907056 551251581514 618879031632 761781682043 550024288320 624342589306 61...
output:
174
result:
ok 1 number(s): "174"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
98 276234289538 276435628434 280525066271 426776261023 1097162807743 1097363685375 1087951250 859273990194 4309160351 864646910399 860553736626 276234293650 495327959007 864642715711 280525062159 4304961551 5378719759 348204339231 280529260959 1097364142527 280730595743 495529292191 1010893910463 10...
output:
110
result:
ok 1 number(s): "110"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
68 394201661537 549394440821 549394178661 1099503239159 488557772900 145090412581 144956194852 462787969060 325347967008 531641925749 462922186789 282532511777 549411354231 549680178807 325482184737 1099234144247 1099503103607 76235669600 548687389284 532212367477 256625344612 548821869173 549680314...
output:
68
result:
ok 1 number(s): "68"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
54 514313778046 514313813886 81942544928 497669898095 494448209774 357005026154 512703000431 496058917759 496596025198 514850780015 219536687652 13155959328 515387686783 8860467744 82093548392 13306954272 513239835519 497669862255 511629091694 515396075519 9011462688 512702964591 2097664 51538765094...
output:
54
result:
ok 1 number(s): "54"
Test #14:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
81 69795316278 7523011620 901144743607 275951648773 1073741828 621967642166 5372903428 71943327286 626266803766 344673223223 351120395831 540133691007 1090124320311 1090158005887 540100038327 351128829879 282400918565 896845549111 351154114303 540133723903 346821234231 348972384823 1090166407039 322...
output:
81
result:
ok 1 number(s): "81"
Test #15:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
44 5411176842 31453621226 5671225632 5411185610 5679614378 5671234400 856154451946 4841930890 5679876523 31453883371 858319044587 5940838656 5679885291 6217935851 832544784362 6217664938 832545046507 6217927083 5679623146 6217673706 5949236170 31991933931 858318782442 5402796864 7843953642 319916717...
output:
58
result:
ok 1 number(s): "58"
Test #16:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
77 481034223583 480413171607 1073807361 37616164743 443973091295 37614586113 205526744983 1030790053855 989031301087 31576366983 1074791938 480967081879 169018994451 338271866627 475782164315 164321902487 439274942299 1108348674 481036320767 480479784795 443905421075 306462265091 480412643091 342970...
output:
88
result:
ok 1 number(s): "88"
Test #17:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
82 272174463709 17246986261 18359263381 91642145429 267745274005 113252276425 547052501727 17179877396 274720403221 134592899733 821949151965 115802410369 684367587989 229089487509 113113860097 115798215937 3863741825 91637950997 409605159647 503963331095 229085293077 132978093333 1179385985 8734717...
output:
122
result:
ok 1 number(s): "122"
Test #18:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
54 2109536 921967046467 1099171741543 578354952800 921969147747 923111178111 575525625920 1219768932 1060550197119 1059408166755 991746702182 853230791490 923043938151 575525879808 575525617664 647089106497 923041836871 0 3902024260 854305581894 1060482957159 991813942142 579427641924 2829335136 142...
output:
56
result:
ok 1 number(s): "56"
Test #19:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
112 1099477022463 756484767267 789981003447 790140810943 22758818854 774948617763 756451505707 583822859966 584091426494 756485062187 760209286151 18388354082 573085146662 536892962 779210028583 22683321382 22683321350 789905800895 34033129142 583713806014 572514698246 33957631670 572439200806 77894...
output:
166
result:
ok 1 number(s): "166"
Test #20:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
35 941452556157 627065233440 907084428069 907080233248 941452687359 1099494848511 958767560703 907080365490 924399433655 901980959269 902785216544 1099494717309 901980960309 907084429109 958767429501 1047811716917 906271782192 1065126590261 902789412405 906275977013 901976765488 902789411365 9070802...
output:
35
result:
ok 1 number(s): "35"
Test #21:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
73 1099243190263 479683662551 470890992133 1029382787863 329152352773 141738639360 36523999744 141738659844 1029381715735 1099243181047 329152332289 54274314757 54274294273 0 549487376119 416616677376 470890992151 549420192311 178262659588 1029449962455 416616697860 292628332545 1020657292055 20484 ...
output:
75
result:
ok 1 number(s): "75"
Test #22:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
60 126720696480 40819253408 813920904114 1090787437562 728664138658 539305993192 728018191234 41364512928 286880 728019461042 814020322210 178258183040 262144 539851252712 728118879138 728120124338 1090921660415 1089847392255 1090787438587 40819228800 178803467168 814566827955 1089713170427 81456682...
output:
62
result:
ok 1 number(s): "62"
Test #23:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
188 632311943094 147138318536 649492156292 909358280503 237602068168 651501194752 9665777664 770858164044 790047481544 77312033330 151701820488 632169336498 787895770696 805285044222 807294082682 651643834244 701995555912 376102151731 1082331414527 649349549696 736422436040 772867235400 736565042636...
output:
306
result:
ok 1 number(s): "306"
Test #24:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
46 129997256715 78407313819 1092078581803 1040475761083 8593088515 1040479988155 78403086747 1099477925375 1094243367419 1094213711979 8590991362 1092065703979 69796366347 1099511496703 1040463210539 1040471861291 1094230489595 1099469274623 78384211978 1040488638907 3145731 78390536203 109422658980...
output:
46
result:
ok 1 number(s): "46"
Test #25:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
85 497140360702 77645758816 77780107750 217387516390 409074525691 357524431330 492299928034 409066136035 543841632739 357524562406 357532820986 409074656767 404234355175 82612019686 492174099832 78182637824 548673675751 497131839970 268435712 77578633216 353103570296 497131971046 222085079392 352692...
output:
99
result:
ok 1 number(s): "99"
Test #26:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
48 326495241995 330795507599 334016733071 274886350211 292135556483 1030657867759 8425473 327338874767 331634892687 1099511627775 309246072587 316763332491 480885014479 334856118159 326495295371 475749611471 326499489679 292135503107 334872895407 329720715151 326495278859 274886296835 8388609 343681...
output:
48
result:
ok 1 number(s): "48"
Test #27:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
72 41547483650 1007007095631 36042459651 35975070209 1099478072219 50170976838 1099477015451 41547221504 1013585861455 1099460008579 1099511626719 1084291304067 1099493563079 1006973541131 998316179969 36042197505 1092914830287 34901328384 998349996615 1092914797255 41581038150 1099460041611 9983833...
output:
80
result:
ok 1 number(s): "80"
Test #28:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
50 196608 10203109376 10219886612 1095149026559 1077969157373 1082264648957 978744990869 283468321793 1013238955157 8590200832 285097810965 559421788288 834836847745 0 8590397440 1081962626237 458752 559438827668 8589938688 9666236416 262144 869347589269 8590135296 1026425355479 834316752021 1030720...
output:
50
result:
ok 1 number(s): "50"
Test #29:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
98 990910277751 648537499794 652832471954 648537504402 927559379286 72582471680 567251847184 652681476882 552823465984 790271551923 1065149463543 1060854491383 1065151888383 622608300544 927559383894 923415411414 582888253714 622615109632 639947565200 790120561459 720327338291 576378693650 639947569...
output:
100
result:
ok 1 number(s): "100"
Test #30:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
51 551905919014 612343036974 618399793151 560500047910 596740160574 551906188326 820338606079 595280576046 594861104174 586686447150 586535149614 2149580838 614180175871 551903821824 595280576495 2147752960 612494065647 596740161023 618475290623 562379373622 596891189247 2149850150 596739891262 6124...
output:
51
result:
ok 1 number(s): "51"
Test #31:
score: 0
Accepted
time: 0ms
memory: 3888kb
input:
196 548915379187 414686890643 274949409299 274962022400 412518402563 1096523710327 518829603555 312528276099 862313483991 999882477255 450109852355 585204174423 549721734139 413341567499 2563 1068606422775 412539406867 516698929763 1068585418471 414670342835 450118535843 480187501491 450105920179 99...
output:
228
result:
ok 1 number(s): "228"
Test #32:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
60 138858799744 17525909122 718835005383 237832224707 567298668486 443819472834 224808648642 1062466994119 431056332739 138875745216 346072000 346038912 156038669954 499687604162 156194289603 774564462534 705811429318 156055615426 17542821506 512572506050 980829059015 362984384 362951296 17525942210...
output:
60
result:
ok 1 number(s): "60"
Test #33:
score: 0
Accepted
time: 15ms
memory: 19636kb
input:
9363 1043131227225 785298644298 785298644426 768051666240 776706678080 767112121448 1043062021200 208361622848 775366593858 1090376130011 1043131489633 768119360840 974411488610 1043130965088 768253582699 1099503239167 758184631616 775635029450 225541496128 768253578587 1064614976979 768116743232 10...
output:
16968
result:
ok 1 number(s): "16968"
Test #34:
score: 0
Accepted
time: 14ms
memory: 19572kb
input:
2896 279173926961 846780829747 1065092872063 1065126425211 927620366199 855102738993 838194958641 856445039411 962047213431 893302570615 1061829703291 1099452610167 1099452872567 1099511330423 829332394609 1062903445107 847049675313 927712900727 838461313907 927662307191 927628752499 829869265521 10...
output:
3242
result:
ok 1 number(s): "3242"
Test #35:
score: 0
Accepted
time: 14ms
memory: 19620kb
input:
5806 67747361867 62378589249 961779068895 135326051801 45131539529 136803495131 66740597835 135460142171 45130951761 62311185473 616496381011 66606447707 8623692800 131031084235 66606185539 66807901259 136472145371 66606376011 131102256219 135800007755 63385316355 66606316889 549730631391 6852872552...
output:
8219
result:
ok 1 number(s): "8219"
Test #36:
score: 0
Accepted
time: 25ms
memory: 19556kb
input:
20232 1090921430942 1090300673983 39763607956 1013926516116 877261247888 877292836244 881856279996 1090300870079 1099427347871 878236663262 403105709534 39736329620 51816432016 327495996816 950714161086 1096743387103 880750908816 1088119627676 602650722704 314918355348 538229407228 877247612304 1099...
output:
78774
result:
ok 1 number(s): "78774"
Test #37:
score: 0
Accepted
time: 13ms
memory: 19568kb
input:
5139 696332950770 146048129170 137975830656 715798715890 696324496880 137447708800 137978222720 137600800896 156249200882 137458194900 139203517616 146585524720 687743016432 147799251154 1099243191807 697415081462 198108289522 16 147659267250 704939662578 139067234514 2627584 713529613814 7072045869...
output:
15731
result:
ok 1 number(s): "15731"
Test #38:
score: 0
Accepted
time: 75ms
memory: 20348kb
input:
92751 19226398471 466168229634 53868441352 483721512849 285509390151 148732054336 157593374531 586281364234 2164697856 603640573192 449706954739 184645783526 2156015360 607930985768 320531836739 607792982312 569672118025 17339747592 423861595985 208863563587 706539785481 552081043208 278116935688 21...
output:
702105600
result:
ok 1 number(s): "702105600"
Test #39:
score: 0
Accepted
time: 33ms
memory: 19856kb
input:
50596 1044378063700 773679969876 786716949844 1052852714324 642835340636 787874543444 1044294160924 1095971208020 155338228820 164180358484 632363219284 924272270676 1080166981492 232748445524 918871186772 1062785898332 667783044436 1063658198868 228219975508 780509369692 155304681556 782638872404 7...
output:
1422915
result:
ok 1 number(s): "1422915"
Test #40:
score: 0
Accepted
time: 14ms
memory: 19584kb
input:
2479 292062167685 506461238943 1065067427487 504159745669 503086917271 498792075927 499597391495 1056561430495 1090442958751 1056485619423 506324924063 1065151332351 1090854584287 1056485899999 1056198563487 224450909829 1099158747103 1064933211871 1090846144415 481075208837 1099494801407 1099427165...
output:
3194
result:
ok 1 number(s): "3194"
Test #41:
score: 0
Accepted
time: 12ms
memory: 19544kb
input:
857 1027051462450 752177712950 747861251634 1027053525818 168040665610 1027057754046 1096113962943 1027055619898 1027055623994 1027055656506 1027055618874 1027057753662 1096248172478 1099469398015 752177716018 558882619426 713501966866 717817971506 752173522738 717813777970 1027053522486 75217770962...
output:
926
result:
ok 1 number(s): "926"
Test #42:
score: 0
Accepted
time: 12ms
memory: 19552kb
input:
729 1007882857455 1007857689511 1095132756967 964760019879 137439740036 964757889447 1008822363047 696323416453 1009233427455 1009187269607 962610373543 974562173863 1008956599279 1009225018343 550293479844 973485368231 964757824423 687196602757 1078020008935 1026480405487 974424892327 1009292147695...
output:
750
result:
ok 1 number(s): "750"
Test #43:
score: 0
Accepted
time: 12ms
memory: 19704kb
input:
911 250208975438 146054602818 171798773760 250207631946 249671838282 802852700014 249672105550 180414406658 1077730475855 137455730688 180397621248 249133918790 171815469058 1075448774255 249134082114 1082293878783 1099205312495 525690862158 250207822402 249135230538 137438969856 250208972362 249133...
output:
1038
result:
ok 1 number(s): "1038"
Test #44:
score: 0
Accepted
time: 18ms
memory: 19708kb
input:
3893 936457994275 1077164338019 1081421579043 1098697923435 1081782264675 1082298190707 1081790689151 1098706321387 386567962659 869919048227 1081413192499 1081690016571 1098706321407 592858316803 1082029753331 1082323363683 1077126581091 1081513862011 1081526448099 1081513864827 1098697917027 42951...
output:
5788
result:
ok 1 number(s): "5788"
Test #45:
score: 0
Accepted
time: 45ms
memory: 20240kb
input:
72623 18187436577 977070332837 275550443809 846069685159 835266189477 619483136800 567608234464 640897239849 852513151781 966331862577 121210329568 354026394145 940492970925 19002219108 1822301156 994250226595 930868272032 2089688033 827739741089 706484263871 362803026340 869624847333 361458227873 1...
output:
7545696
result:
ok 1 number(s): "7545696"
Test #46:
score: 0
Accepted
time: 37ms
memory: 19808kb
input:
52845 735652102216 177525506852 177374511368 173079544384 1010858354540 185989620588 173281011494 461067801902 177625122602 976464118054 737742177124 178682086186 731442332516 181476541028 10164633890 188337375074 176468542252 185762071296 735972180808 727196393832 735929189668 181896234342 73138230...
output:
1696968
result:
ok 1 number(s): "1696968"
Test #47:
score: 0
Accepted
time: 17ms
memory: 19704kb
input:
2139 1043609811930 1077699017608 1075620740058 138139402368 422681617280 1077667560333 1082063191003 138140002944 1043576257422 414091701128 491401112458 1099176083439 1043574160264 422682682250 414091641730 972438500234 1082063191002 491435719626 163578496 146192991104 1082264517582 1082262420428 9...
output:
2564
result:
ok 1 number(s): "2564"
Test #48:
score: 0
Accepted
time: 11ms
memory: 19588kb
input:
7569 1082305413019 933222261387 1073078467211 1082323368635 1081702082699 519060095115 532482997387 378093527177 1081978256283 521169610881 1082247347115 520901175427 1081710869151 1082036435851 1070657282187 1081995033227 1073145559947 1070960323211 1082247870639 1081977863115 929191477259 10822394...
output:
30380
result:
ok 1 number(s): "30380"
Test #49:
score: 0
Accepted
time: 17ms
memory: 19640kb
input:
2746 1030695612285 1030716649341 1065084780397 1377830724 1343227392 1030716588015 979156002668 415573771876 463763930988 35653120 437854981988 415842207332 480969224061 515328966509 296121200484 1099511623679 463759667052 1075840512 278101231168 326186493796 1065059282797 150092310084 463764123500 ...
output:
3239
result:
ok 1 number(s): "3239"
Test #50:
score: 0
Accepted
time: 42ms
memory: 20148kb
input:
69143 859396507649 1011997931519 937737744079 936658758849 1094677069519 886136294087 827133553857 930147749447 928200811737 862600588063 861509053279 954918662043 1076423456493 861494733897 886156188357 870093055119 869011712713 861426311233 957025275589 860352545809 938803130057 585675858121 86055...
output:
4791600
result:
ok 1 number(s): "4791600"
Test #51:
score: 0
Accepted
time: 17ms
memory: 19552kb
input:
4916 361507398830 547608192446 361775572102 533576623278 499013461134 548613219583 544386035646 361205146766 387245737006 395860837422 544314057919 543305327790 398285153454 541898122286 542168130815 542234764479 395867128878 545455583231 361473836046 533643764926 499281667263 543313229759 544381709...
output:
6577
result:
ok 1 number(s): "6577"
Test #52:
score: 0
Accepted
time: 16ms
memory: 19568kb
input:
941 721553976533 790273965265 1099511627229 697882223824 721542950101 790270831825 138311640080 721550830801 790262426845 721545067728 721538624733 721551342804 790264523997 721540869341 721538772176 721542966737 790270832085 721545063633 721551228373 721542966493 719390631120 996416683225 790273961...
output:
1027
result:
ok 1 number(s): "1027"
Test #53:
score: 0
Accepted
time: 36ms
memory: 19816kb
input:
51301 143911698630 15045772438 118713368710 49960200390 111155266694 247004151956 415047368912 8100003990 41890368726 15091130518 50532961478 256638714004 105777987780 119241796822 204028815574 15054308486 1098941185535 204639940310 273869031638 119250349254 754947312854 462255292550 668947229910 47...
output:
2559612
result:
ok 1 number(s): "2559612"
Test #54:
score: 0
Accepted
time: 22ms
memory: 19556kb
input:
4546 549487378427 1090650136 134341423418 961124761595 824491111418 132192891290 130045407770 136487858586 134341409722 95618289690 78505521466 549084723199 549344769023 132192925147 686243707899 136454304570 134307868986 136487894010 549478989823 26932371482 29113397530 411635284987 130011837370 26...
output:
5382
result:
ok 1 number(s): "5382"
Test #55:
score: 0
Accepted
time: 17ms
memory: 19640kb
input:
2005 434148738816 537239889664 1087566227306 502877914880 1086995773192 537239891808 292412729088 1086995801960 429849715968 292416398592 429861250816 1097364127743 1087566167912 296711890176 154987529216 502876735232 21837251840 429845382912 429859022080 1086995775336 292426352384 365440009984 1018...
output:
2820
result:
ok 1 number(s): "2820"
Test #56:
score: 0
Accepted
time: 16ms
memory: 19632kb
input:
2260 548596612478 234761707586 445518407998 441222916202 514236868714 149094402 445517094922 548682066943 445517883710 548596836430 548614924414 166344222762 445483540558 138158497802 1098420584315 514253645950 509941901418 445517883518 479962589566 170370754602 445248661610 445215105034 51423683622...
output:
2405
result:
ok 1 number(s): "2405"
Test #57:
score: 0
Accepted
time: 21ms
memory: 19632kb
input:
3345 1065120261989 1065151195111 1065084614607 1042504507716 1063994549572 1065055776583 1065082972005 1065082513221 1099443828727 1059683853637 1064005035333 1064054908741 84460986436 1046799017285 1046797968709 1065151201223 1064063296837 1099438581573 771919994948 71538311172 1099511463887 106400...
output:
3763
result:
ok 1 number(s): "3763"
Test #58:
score: 0
Accepted
time: 17ms
memory: 19640kb
input:
1468 3221356800 124234742767 20545184728 20409520128 123693675487 956955606015 20543869782 89130308360 123624399834 20544783176 89264665544 20544926556 20543869780 20544918358 20543738730 20410929416 123695707086 89264399322 123691512796 673990554607 647683881983 123624469455 20612365295 20401095168...
output:
2446
result:
ok 1 number(s): "2446"
Test #59:
score: 0
Accepted
time: 21ms
memory: 19616kb
input:
1622 497726949875 344169284080 345247236594 515311652351 33685504 1097280244223 345255608690 532489947643 275453624624 69295439922 344169283888 1099511627771 530359245307 515396074491 69291114800 547524431359 575668240 515328429567 495998978546 1062919981567 497995401715 16 513164692979 345247236592...
output:
1901
result:
ok 1 number(s): "1901"
Test #60:
score: 0
Accepted
time: 29ms
memory: 19816kb
input:
46202 646410125400 98672820681 223880134744 228438786376 271278924249 642912043080 88076959961 651630985416 155424325840 274755993816 818330225113 642903162944 208326902209 644246814856 781701366216 788685078985 638365925568 652715182537 230318358984 638356488384 717260276160 274790597081 2276513467...
output:
579600
result:
ok 1 number(s): "579600"
Test #61:
score: 0
Accepted
time: 17ms
memory: 19612kb
input:
623 333608342070 333608342078 1090615464702 58595627046 58595693094 402329918062 333465145894 403424639742 333608276534 57983254562 23622324226 1090653256446 58520649766 23622320130 57983258658 333465670182 333473403426 1090883902206 58596217398 58520130086 333473927218 953159471870 1089524683518 10...
output:
633
result:
ok 1 number(s): "633"
Test #62:
score: 0
Accepted
time: 20ms
memory: 19768kb
input:
812 675035634746 86490764346 90752173104 675035633722 120280072240 674903512114 953480830522 951333576254 16793616 125114139704 678536044094 674901415482 90781667384 950855685694 674903512122 1090920578751 675314555962 90785861688 678256860734 1090921168447 953137389118 124608598066 678603152954 125...
output:
851
result:
ok 1 number(s): "851"
Test #63:
score: 0
Accepted
time: 48ms
memory: 20092kb
input:
74932 24452244708 670324600437 157086524980 93168037616 11040966244 69079731960 139873651748 8879113908 137708504624 189281954916 262823306992 53973790268 26073736804 409967355891 189301368572 33134438115 670391723893 67603245038 67451954930 53957305956 32777922298 606663159784 124947621625 64296341...
output:
35398080
result:
ok 1 number(s): "35398080"
Test #64:
score: 0
Accepted
time: 11ms
memory: 19612kb
input:
7890 541698390101 477277021905 1024848686165 541701537365 1057097610865 1080716819541 1029181505245 1005553541201 421050015760 475130621565 475092840021 1074273273877 477274009341 1091458563709 455411851284 541697339005 545997586173 545993522813 1096827240055 548145069693 455781217365 1029181537917 ...
output:
11762
result:
ok 1 number(s): "11762"
Test #65:
score: 0
Accepted
time: 30ms
memory: 19816kb
input:
46127 1098399047675 1093551477671 971143119462 792902138819 1060818121727 550102123270 1042011903911 146375344643 859465712483 1084960443298 1009802770423 1007650521827 990471130786 1026983689207 962209960867 996636246754 1090362735599 724182649414 1042028617647 1090367968175 964702489319 6875422909...
output:
602544
result:
ok 1 number(s): "602544"
Test #66:
score: 0
Accepted
time: 26ms
memory: 20032kb
input:
36298 811949893796 1064346418159 1053507201509 138646913092 796179315591 807654402500 1062467354037 813089696181 791548799383 1062194720149 1083606579685 1053607869911 1097296951703 761551141309 1053603674527 756110076076 1062198852039 810938153967 1049309753741 770946448823 757139505605 77862929447...
output:
226626
result:
ok 1 number(s): "226626"
Test #67:
score: 0
Accepted
time: 16ms
memory: 19560kb
input:
1531 663892445963 939844098763 655302508675 1077828901839 105546565634 1099438218191 939844094282 34661761024 938770221643 664966256907 656376254603 656376121419 664966037504 105546563595 664966191490 939844096011 938770352331 114136631627 938770352715 930163638400 939844094026 939844093955 93877035...
output:
2042
result:
ok 1 number(s): "2042"
Test #68:
score: 0
Accepted
time: 52ms
memory: 20432kb
input:
88175 983036347017 652914884624 810754937025 792971108424 707135679421 981945303384 574566601748 25348968458 711899349268 106917720634 673852879388 741427651354 707981119764 776398353200 586808484425 791423222672 21018374794 3766674008 326962905240 124026266251 708141654043 777237797246 277638291547...
output:
352382976
result:
ok 1 number(s): "352382976"
Test #69:
score: 0
Accepted
time: 17ms
memory: 19644kb
input:
1371 60814529939 128997274899 683621168639 43085205762 129569862931 60273661203 335691068791 43088089090 112387888563 60816831863 60810532115 1099243143167 335688447287 546266134007 1099511592959 954204108279 128995176707 60139373843 954220885495 42959508753 1098437834231 1098068735479 42959372545 6...
output:
1795
result:
ok 1 number(s): "1795"
Test #70:
score: 0
Accepted
time: 18ms
memory: 19572kb
input:
13315 407559469432 319438456889 405411789117 371047069756 388225091641 362390132796 371045361725 542846539964 130529556733 412274916222 371045845032 336687306809 336685582396 130529556724 319505582141 96169809968 69256349712 545023588863 1099208260607 407709876158 10267838521 304475461688 7784646866...
output:
86482
result:
ok 1 number(s): "86482"
Test #71:
score: 0
Accepted
time: 21ms
memory: 19584kb
input:
5275 989586713593 696326998393 706023180665 993865428991 991650312185 716762967545 751123229691 714614163835 1026228678139 990634241531 704916146296 704915851376 989567314811 698510920187 4194400 989721456639 687736810363 991649787899 988417289721 713542486897 713506868089 713507654011 704949307763 ...
output:
8520
result:
ok 1 number(s): "8520"
Test #72:
score: 0
Accepted
time: 12ms
memory: 19612kb
input:
686 1099511595007 799711177072 819038596464 802933259600 817964789104 765074610512 800784988528 1077950627194 799711173968 800784985424 765049440512 820248132978 1099444387839 799400790336 765041056080 820252589434 818065522000 799669225808 1099421023742 1095130512766 824543116798 818099076470 82025...
output:
743
result:
ok 1 number(s): "743"
Test #73:
score: 0
Accepted
time: 12ms
memory: 19556kb
input:
1320 1060291728893 346018337977 1056969610681 904498271385 1060258177017 361050689681 1033280279993 1060845387773 483457258905 1099509520383 507079578009 352187859089 1095205126143 1039655522745 1059184434681 1033213072793 1095205115903 1060191065531 489899709881 492047226297 1059050182649 104180300...
output:
1407
result:
ok 1 number(s): "1407"
Test #74:
score: 0
Accepted
time: 21ms
memory: 19560kb
input:
3929 1081752943357 1081752894207 360194981629 84159444725 1081750829813 79591651969 83903527425 10737424897 944313974779 84228651521 75301075457 84176221905 84246477541 83976993457 360198127349 85051783813 84226554545 79881253605 1081750535925 1081752910581 531993673469 1099503189751 8724288001 9443...
output:
5523
result:
ok 1 number(s): "5523"
Test #75:
score: 0
Accepted
time: 20ms
memory: 19572kb
input:
329 1099511103423 571768796174 549755814912 573951931919 567473746944 1024 571770876942 567473812482 848838226959 573918376974 918971446959 567473603584 566937916418 1021106943663 1089847918511 567473763338 567473734656 1090921658287 850247775791 573952194063 1055487655855 567473808384 573926765614 ...
output:
334
result:
ok 1 number(s): "334"
Test #76:
score: 0
Accepted
time: 16ms
memory: 19548kb
input:
692 1090921562095 1073739726831 1073437736943 797402070765 1090617606127 1070132489445 245485127909 1070132494309 241190095013 1099240964079 1073389502207 68719755428 796328328933 244813940900 794703972581 1073456479983 1090567274223 1089543733229 1072313532389 1090904784879 1071273344997 1070161849...
output:
711
result:
ok 1 number(s): "711"
Test #77:
score: 0
Accepted
time: 17ms
memory: 19624kb
input:
2802 1082051787731 1081900265170 1081900526546 1081498139603 1072773555154 519791747600 1082034617296 1082034613203 1082043400186 1082034617299 1082034596817 1082000534224 38721814528 1081389088755 4362084368 935300539088 1082328608759 109589013136 1081372311258 1082034220754 1082034615249 108176631...
output:
4712
result:
ok 1 number(s): "4712"
Test #78:
score: 0
Accepted
time: 92ms
memory: 16252kb
input:
98010 230857327564 145039065430 432723995652 659303784474 694751363970 148194329681 208325857284 25369936322 3510109440 556226646107 216899765610 552994341136 703317868812 247044526107 139670392908 83820103000 564882575697 148718060074 19868975106 174024826963 695036182982 209399632966 212604667278 ...
output:
29812064256
result:
ok 1 number(s): "29812064256"
Test #79:
score: 0
Accepted
time: 144ms
memory: 16292kb
input:
98734 671097410 151065122 652974187042 43486775298 43554243074 125996892544 653188748576 549979160610 653107724322 138510954 593242431490 636028518688 549843976704 43206578944 379131793424 584253966402 77314265122 148722294797 560627550286 618542407682 627149180930 112156807200 558480042570 73028352...
output:
549755813888
result:
ok 1 number(s): "549755813888"
Test #80:
score: 0
Accepted
time: 54ms
memory: 16276kb
input:
91436 90200617102 373868673759 348530946244 424775188676 623166731718 154621132814 73014678600 274392632516 1062561856983 550639833542 90269923526 11330617551 91044776646 101824311492 1064359640543 76057097423 756191154761 834126938591 558454997399 73667802830 708672864902 352392324 549881758086 171...
output:
627217920
result:
ok 1 number(s): "627217920"
Test #81:
score: 0
Accepted
time: 143ms
memory: 16236kb
input:
98267 2051312171 95647269120 413694755331 147824394275 714038428202 121349866499 165123803691 420372314153 628290011137 9934499881 122021184771 585189294080 637404267776 157873914379 432718103074 164505042984 121450659843 287496798761 550902072784 18481284352 78488028675 431377875498 87694655745 957...
output:
549755813888
result:
ok 1 number(s): "549755813888"
Test #82:
score: 0
Accepted
time: 72ms
memory: 16324kb
input:
96568 38521705242 20436205853 623378776836 269734164 104104035103 623653552384 704384472320 704988479824 571846590864 554396946576 293841640023 121165336832 88840898906 587069882900 142014190224 567744173456 154620990416 348232565508 622838792980 277172740 552982528020 17464529808 121300681494 18959...
output:
4463050752
result:
ok 1 number(s): "4463050752"
Test #83:
score: 0
Accepted
time: 103ms
memory: 16280kb
input:
91013 335616236590 855306901759 555126640786 569487987090 889328829906 5293604907 567816948126 858272645526 344379686914 292705798182 988451248303 190657879110 329481455622 602640291287 569687541934 20199899154 569421267386 835394818267 1166016514 291118272550 18113169719 305215390062 551920599222 3...
output:
26924285952
result:
ok 1 number(s): "26924285952"
Test #84:
score: 0
Accepted
time: 74ms
memory: 16244kb
input:
94006 171883564048 2240173064 137494087648 37400783168 207023391476 1066881740512 587153089632 2701672451 553539857888 103172494340 34989876231 758658294768 688017400948 36331219328 253122634712 492802008536 103173866499 1033493931248 241173283556 759724486240 138295207440 208902366980 689938572896 ...
output:
4010803200
result:
ok 1 number(s): "4010803200"
Test #85:
score: 0
Accepted
time: 42ms
memory: 16040kb
input:
86017 595445307170 689395259110 964264755942 964549989572 552029279520 416204117700 139756357541 140428085189 1000225801380 827756954598 724551517922 444577870834 1000238540164 725429175796 751480078292 2743096612 552074252837 724272432128 725350008822 552609006981 416139638436 139700234038 14124021...
output:
630434304
result:
ok 1 number(s): "630434304"
Test #86:
score: 0
Accepted
time: 78ms
memory: 16472kb
input:
92892 711087667650 189817579658 561618461024 34359878482 138785606610 69812232706 160793913346 35701934288 214533602371 576868854080 243504703682 243742708066 70070470288 1371963472 104155226114 716323336514 139321178250 69028051210 224969245827 203259149411 51539739010 25185803585 154625524226 2061...
output:
8599633920
result:
ok 1 number(s): "8599633920"
Test #87:
score: 0
Accepted
time: 85ms
memory: 16468kb
input:
94636 448899657228 435950781058 291524578048 274912027394 283482541956 874094003074 987849829120 843963171328 442453206924 871956037760 429500997640 1067312491008 298573654530 337163671180 910645267330 348969773824 285652034434 436006367872 298571624196 317829677056 932177905880 296361149188 3200092...
output:
77007421440
result:
ok 1 number(s): "77007421440"
Test #88:
score: 0
Accepted
time: 63ms
memory: 16444kb
input:
94603 38820422832 690550311480 201493521 46573564960 60263801985 604949708816 61338559650 962249228964 965436965548 574855611520 421855537696 3390054577 481550935205 38788956160 37733044386 149954791864 551039306884 980763576496 137850008756 355662816745 13288644608 20816339088 862382494753 78813913...
output:
5861376000
result:
ok 1 number(s): "5861376000"
Test #89:
score: 0
Accepted
time: 71ms
memory: 16288kb
input:
92156 264897555628 142027704484 19394613264 5318901948 61657501644 140283664556 49812424858 44342349508 140468160684 339170215836 36977051664 275372999764 273730751662 144175945900 116971341896 108783536256 339182798044 409365367390 119068760204 137992628460 324052060958 58057687084 32843423934 6175...
output:
742993920
result:
ok 1 number(s): "742993920"
Test #90:
score: 0
Accepted
time: 148ms
memory: 16412kb
input:
99252 94507237672 116120496553 322278787080 10486024274 558568571144 25791955202 68871127424 214832513296 549911658664 34411186464 936320698792 206179797032 863449450505 34515978624 559771945090 18746968704 597185658914 313685332000 77466306697 837569489152 309288184104 413814753450 137523497098 959...
output:
549755813888
result:
ok 1 number(s): "549755813888"
Test #91:
score: 0
Accepted
time: 76ms
memory: 16288kb
input:
94638 68736358406 1100487809 556233003441 833559233284 9321165200 556466802944 564831459714 69125382172 558554415124 78257399958 68879915412 2316326275 619149572374 317834952718 11344577300 550026387464 627342420358 833496326170 584386125966 9160821137 200753 556911366579 277031682574 78300357012 58...
output:
26499612672
result:
ok 1 number(s): "26499612672"
Test #92:
score: 0
Accepted
time: 157ms
memory: 17032kb
input:
194811 601145020761 573091164874 725463376910 244197992298 639560410107 259143839525 111428071202 130224575294 15364002126 93257476331 1054692710662 132309078911 943530715454 813029409576 412206624186 34452820435 53685804949 658626581408 130258649003 89325416930 398754349358 952209068457 39614659457...
output:
97844723712
result:
ok 1 number(s): "97844723712"
Test #93:
score: 0
Accepted
time: 80ms
memory: 17080kb
input:
197081 1000687578971 858812387065 613999288138 377901067774 1060710108789 514795560138 513223614458 734265577471 1060827418199 784765939451 343416422123 996382089208 940408643291 927247146304 481014816127 1098970541566 512455497078 510550336873 1095019191931 513051328510 1099356372475 1026306588667 ...
output:
222931008
result:
ok 1 number(s): "222931008"
Test #94:
score: 0
Accepted
time: 170ms
memory: 17048kb
input:
197836 239551075983 830035054863 791229759121 253507903228 361052952768 370429746922 303813424084 556276373607 82071223333 194343866567 561451807514 278438326571 461522263715 213459393990 332389101568 984320876065 41535770787 192847929179 496552639409 329210155165 845630774172 959654671419 741380306...
output:
549755813888
result:
ok 1 number(s): "549755813888"
Test #95:
score: 0
Accepted
time: 112ms
memory: 17192kb
input:
195675 119602426866 268035702269 526131984381 1097345843199 666089725623 396517881578 766350229408 66593535842 611714733619 83746551530 119421173589 669287995929 67513237477 526593490789 526847082301 909152010151 889477561482 618814804143 947495911384 251334164456 824126873523 63625009072 2574567669...
output:
8515584000
result:
ok 1 number(s): "8515584000"
Test #96:
score: 0
Accepted
time: 84ms
memory: 17056kb
input:
192218 545141462555 884354890367 987517755007 687138723563 64200609503 369281638378 981029352975 396993494911 953359957839 132791049928 929752465371 639546947183 549716844063 953360947071 957689880175 1014408650446 785940537087 1029415540607 914475169743 331646148334 1099191517151 259520837134 87578...
output:
734411520
result:
ok 1 number(s): "734411520"
Test #97:
score: 0
Accepted
time: 84ms
memory: 17072kb
input:
199038 474191167346 1096942807670 525713739237 545032482439 525293174725 258989792082 538186595070 407731329774 1096541781351 1079818538598 452716121973 334596053618 977222479094 1012135866223 690523929428 443538672751 268140793727 706655161447 385548728692 951553002725 44190691178 936034369135 9423...
output:
910780416
result:
ok 1 number(s): "910780416"
Test #98:
score: 0
Accepted
time: 106ms
memory: 17200kb
input:
194891 540019956699 1051186231709 534909845497 398588166095 207689145494 673268276117 57528868827 810466606525 359044659545 606088764364 1068539885823 244439227807 496797530365 401797201899 261058075865 547251600216 128326342989 72646180061 344109153469 1032829802651 760187378171 780455034873 104015...
output:
1617920000
result:
ok 1 number(s): "1617920000"
Test #99:
score: 0
Accepted
time: 112ms
memory: 17048kb
input:
197301 97433463453 204643724953 270505780787 98264972707 450959574941 247193859621 347410738621 3327440323 536225949029 440928938927 432342514719 522026151123 261842205295 446564856049 204374653167 494652568325 531868677978 75295583835 536722612277 165883592117 33304833159 127439118451 151990401519 ...
output:
40579891200
result:
ok 1 number(s): "40579891200"
Extra Test:
score: 0
Extra Test Passed