QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#723780 | #1086. Bank Security Unification | maspy | AC ✓ | 183ms | 18964kb | C++23 | 13.7kb | 2024-11-08 00:22:59 | 2024-11-08 00:22:59 |
Judging History
answer
#line 1 "/home/maspy/compro/library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("Ofast,unroll-loops")
// いまの CF だとこれ入れると動かない?
// #pragma GCC target("avx2,popcnt")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i128 = __int128;
using u128 = unsigned __int128;
using f128 = __float128;
template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'010'000'000;
template <>
constexpr ll infty<ll> = 2'020'000'000'000'000'000;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * 2'000'000'000'000'000'000;
template <>
constexpr double infty<double> = infty<ll>;
template <>
constexpr long double infty<long double> = infty<ll>;
using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vector<vc<T>>;
template <class T>
using vvvc = vector<vvc<T>>;
template <class T>
using vvvvc = vector<vvvc<T>>;
template <class T>
using vvvvvc = vector<vvvvc<T>>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
#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__))))
// https://trap.jp/post/1224/
#define FOR1(a) for (ll _ = 0; _ < ll(a); ++_)
#define FOR2(i, a) for (ll i = 0; i < ll(a); ++i)
#define FOR3(i, a, b) for (ll i = a; i < ll(b); ++i)
#define FOR4(i, a, b, c) for (ll i = a; i < ll(b); i += (c))
#define FOR1_R(a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR2_R(i, a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR3_R(i, a, b) for (ll i = (b)-1; i >= ll(a); --i)
#define overload4(a, b, c, d, e, ...) e
#define overload3(a, b, c, d, ...) d
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__)
#define FOR_subset(t, s) for (ll t = (s); t >= 0; t = (t == 0 ? -1 : (t - 1) & (s)))
#define all(x) x.begin(), x.end()
#define len(x) ll(x.size())
#define elif else if
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define stoi stoll
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }
int popcnt_sgn(int x) { return (__builtin_parity(x) & 1 ? -1 : 1); }
int popcnt_sgn(u32 x) { return (__builtin_parity(x) & 1 ? -1 : 1); }
int popcnt_sgn(ll x) { return (__builtin_parity(x) & 1 ? -1 : 1); }
int popcnt_sgn(u64 x) { return (__builtin_parity(x) & 1 ? -1 : 1); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2)
int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2)
int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
template <typename T>
T floor(T a, T b) {
return a / b - (a % b && (a ^ b) < 0);
}
template <typename T>
T ceil(T x, T y) {
return floor(x + y - 1, y);
}
template <typename T>
T bmod(T x, T y) {
return x - y * floor(x, y);
}
template <typename T>
pair<T, T> divmod(T x, T y) {
T q = floor(x, y);
return {q, x - q * y};
}
template <typename T, typename U>
T SUM(const vector<U> &A) {
T sm = 0;
for (auto &&a: A) sm += a;
return sm;
}
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define UNIQUE(x) sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit()
template <typename T>
T POP(deque<T> &que) {
T a = que.front();
que.pop_front();
return a;
}
template <typename T>
T POP(pq<T> &que) {
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(pqg<T> &que) {
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(vc<T> &que) {
T a = que.back();
que.pop_back();
return a;
}
template <typename F>
ll binary_search(F check, ll ok, ll ng, bool check_ok = true) {
if (check_ok) assert(check(ok));
while (abs(ok - ng) > 1) {
auto x = (ng + ok) / 2;
(check(x) ? ok : ng) = x;
}
return ok;
}
template <typename F>
double binary_search_real(F check, double ok, double ng, int iter = 100) {
FOR(iter) {
double x = (ok + ng) / 2;
(check(x) ? ok : ng) = x;
}
return (ok + ng) / 2;
}
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);
}
// ? は -1
vc<int> s_to_vi(const string &S, char first_char) {
vc<int> A(S.size());
FOR(i, S.size()) { A[i] = (S[i] != '?' ? S[i] - first_char : -1); }
return A;
}
template <typename T, typename U>
vector<T> cumsum(vector<U> &A, int off = 1) {
int N = A.size();
vector<T> B(N + 1);
FOR(i, N) { B[i + 1] = B[i] + A[i]; }
if (off == 0) B.erase(B.begin());
return B;
}
// stable sort
template <typename T>
vector<int> argsort(const vector<T> &A) {
vector<int> ids(len(A));
iota(all(ids), 0);
sort(all(ids), [&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); });
return ids;
}
// A[I[0]], A[I[1]], ...
template <typename T>
vc<T> rearrange(const vc<T> &A, const vc<int> &I) {
vc<T> B(len(I));
FOR(i, len(I)) B[i] = A[I[i]];
return B;
}
template <typename T, typename... Vectors>
void concat(vc<T> &first, const Vectors &... others) {
vc<T> &res = first;
(res.insert(res.end(), others.begin(), others.end()), ...);
}
#endif
#line 1 "/home/maspy/compro/library/other/io.hpp"
#define FASTIO
#include <unistd.h>
// https://judge.yosupo.jp/submission/21623
namespace fastio {
static constexpr uint32_t SZ = 1 << 17;
char ibuf[SZ];
char obuf[SZ];
char out[100];
// pointer of ibuf, obuf
uint32_t pil = 0, pir = 0, por = 0;
struct Pre {
char num[10000][4];
constexpr Pre() : num() {
for (int i = 0; i < 10000; i++) {
int n = i;
for (int j = 3; j >= 0; j--) {
num[i][j] = n % 10 | '0';
n /= 10;
}
}
}
} constexpr pre;
inline void load() {
memcpy(ibuf, ibuf + pil, pir - pil);
pir = pir - pil + fread(ibuf + pir - pil, 1, SZ - pir + pil, stdin);
pil = 0;
if (pir < SZ) ibuf[pir++] = '\n';
}
inline void flush() {
fwrite(obuf, 1, por, stdout);
por = 0;
}
void rd(char &c) {
do {
if (pil + 1 > pir) load();
c = ibuf[pil++];
} while (isspace(c));
}
void rd(string &x) {
x.clear();
char c;
do {
if (pil + 1 > pir) load();
c = ibuf[pil++];
} while (isspace(c));
do {
x += c;
if (pil == pir) load();
c = ibuf[pil++];
} while (!isspace(c));
}
template <typename T>
void rd_real(T &x) {
string s;
rd(s);
x = stod(s);
}
template <typename T>
void rd_integer(T &x) {
if (pil + 100 > pir) load();
char c;
do
c = ibuf[pil++];
while (c < '-');
bool minus = 0;
if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
if (c == '-') { minus = 1, c = ibuf[pil++]; }
}
x = 0;
while ('0' <= c) { x = x * 10 + (c & 15), c = ibuf[pil++]; }
if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
if (minus) x = -x;
}
}
void rd(int &x) { rd_integer(x); }
void rd(ll &x) { rd_integer(x); }
void rd(i128 &x) { rd_integer(x); }
void rd(u32 &x) { rd_integer(x); }
void rd(u64 &x) { rd_integer(x); }
void rd(u128 &x) { rd_integer(x); }
void rd(double &x) { rd_real(x); }
void rd(long double &x) { rd_real(x); }
void rd(f128 &x) { rd_real(x); }
template <class T, class U>
void rd(pair<T, U> &p) {
return rd(p.first), rd(p.second);
}
template <size_t N = 0, typename T>
void rd_tuple(T &t) {
if constexpr (N < std::tuple_size<T>::value) {
auto &x = std::get<N>(t);
rd(x);
rd_tuple<N + 1>(t);
}
}
template <class... T>
void rd(tuple<T...> &tpl) {
rd_tuple(tpl);
}
template <size_t N = 0, typename T>
void rd(array<T, N> &x) {
for (auto &d: x) rd(d);
}
template <class T>
void rd(vc<T> &x) {
for (auto &d: x) rd(d);
}
void read() {}
template <class H, class... T>
void read(H &h, T &... t) {
rd(h), read(t...);
}
void wt(const char c) {
if (por == SZ) flush();
obuf[por++] = c;
}
void wt(const string s) {
for (char c: s) wt(c);
}
void wt(const char *s) {
size_t len = strlen(s);
for (size_t i = 0; i < len; i++) wt(s[i]);
}
template <typename T>
void wt_integer(T x) {
if (por > SZ - 100) flush();
if (x < 0) { obuf[por++] = '-', x = -x; }
int outi;
for (outi = 96; x >= 10000; outi -= 4) {
memcpy(out + outi, pre.num[x % 10000], 4);
x /= 10000;
}
if (x >= 1000) {
memcpy(obuf + por, pre.num[x], 4);
por += 4;
} else if (x >= 100) {
memcpy(obuf + por, pre.num[x] + 1, 3);
por += 3;
} else if (x >= 10) {
int q = (x * 103) >> 10;
obuf[por] = q | '0';
obuf[por + 1] = (x - q * 10) | '0';
por += 2;
} else
obuf[por++] = x | '0';
memcpy(obuf + por, out + outi + 4, 96 - outi);
por += 96 - outi;
}
template <typename T>
void wt_real(T x) {
ostringstream oss;
oss << fixed << setprecision(15) << double(x);
string s = oss.str();
wt(s);
}
void wt(int x) { wt_integer(x); }
void wt(ll x) { wt_integer(x); }
void wt(i128 x) { wt_integer(x); }
void wt(u32 x) { wt_integer(x); }
void wt(u64 x) { wt_integer(x); }
void wt(u128 x) { wt_integer(x); }
void wt(double x) { wt_real(x); }
void wt(long double x) { wt_real(x); }
void wt(f128 x) { wt_real(x); }
template <class T, class U>
void wt(const pair<T, U> val) {
wt(val.first);
wt(' ');
wt(val.second);
}
template <size_t N = 0, typename T>
void wt_tuple(const T t) {
if constexpr (N < std::tuple_size<T>::value) {
if constexpr (N > 0) { wt(' '); }
const auto x = std::get<N>(t);
wt(x);
wt_tuple<N + 1>(t);
}
}
template <class... T>
void wt(tuple<T...> tpl) {
wt_tuple(tpl);
}
template <class T, size_t S>
void wt(const array<T, S> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) wt(' ');
wt(val[i]);
}
}
template <class T>
void wt(const vector<T> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) wt(' ');
wt(val[i]);
}
}
void print() { wt('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
wt(head);
if (sizeof...(Tail)) wt(' ');
print(forward<Tail>(tail)...);
}
// gcc expansion. called automaticall after main.
void __attribute__((destructor)) _d() { flush(); }
} // namespace fastio
using fastio::read;
using fastio::print;
using fastio::flush;
#if defined(LOCAL)
#define SHOW(...) SHOW_IMPL(__VA_ARGS__, SHOW6, SHOW5, SHOW4, SHOW3, SHOW2, SHOW1)(__VA_ARGS__)
#define SHOW_IMPL(_1, _2, _3, _4, _5, _6, NAME, ...) NAME
#define SHOW1(x) print(#x, "=", (x)), flush()
#define SHOW2(x, y) print(#x, "=", (x), #y, "=", (y)), flush()
#define SHOW3(x, y, z) print(#x, "=", (x), #y, "=", (y), #z, "=", (z)), flush()
#define SHOW4(x, y, z, w) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w)), flush()
#define SHOW5(x, y, z, w, v) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v)), flush()
#define SHOW6(x, y, z, w, v, u) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v), #u, "=", (u)), flush()
#else
#define SHOW(...)
#endif
#define INT(...) \
int __VA_ARGS__; \
read(__VA_ARGS__)
#define LL(...) \
ll __VA_ARGS__; \
read(__VA_ARGS__)
#define U32(...) \
u32 __VA_ARGS__; \
read(__VA_ARGS__)
#define U64(...) \
u64 __VA_ARGS__; \
read(__VA_ARGS__)
#define STR(...) \
string __VA_ARGS__; \
read(__VA_ARGS__)
#define CHAR(...) \
char __VA_ARGS__; \
read(__VA_ARGS__)
#define DBL(...) \
double __VA_ARGS__; \
read(__VA_ARGS__)
#define VEC(type, name, size) \
vector<type> name(size); \
read(name)
#define VV(type, name, h, w) \
vector<vector<type>> name(h, vector<type>(w)); \
read(name)
void YES(bool t = 1) { print(t ? "YES" : "NO"); }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { print(t ? "Yes" : "No"); }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { print(t ? "yes" : "no"); }
void no(bool t = 1) { yes(!t); }
#line 3 "main.cpp"
void solve() {
LL(N);
VEC(ll, A, N);
vi dp(N);
ll K = 40;
vc<int> I(K, -1);
FOR(i, N) {
if (i > 0) chmax(dp[i], dp[i - 1]);
for (auto& j: I) {
if (j != -1) chmax(dp[i], dp[j] + (A[i] & A[j]));
}
FOR(k, K) {
if (A[i] >> k & 1) I[k] = i;
}
}
print(MAX(dp));
}
signed main() { solve(); }
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3628kb
input:
5 1 2 3 1 3
output:
5
result:
ok answer is '5'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
4 1 2 4 0
output:
0
result:
ok answer is '0'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
2 1000000000000 1000000000000
output:
1000000000000
result:
ok answer is '1000000000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
100 42357619991 34637578715 14383875856 65298594968 204835436802 17842451301 27263566591 56672847581 9938910048 37783918480 178688553850 31652616803 34569713543 278151742734 458183081930 36307485267 52046737444 29733829337 156411959819 70476873663 322768771475 306850928242 68922415915 108092954267 1...
output:
4105724254392
result:
ok answer is '4105724254392'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
200 32491481529 22326116709 38413035282 6379551923 17186666096 710945826 99671547638 21583864468 43358433566 110817310097 58936170734 12118139703 99298292577 7807334015 283126465825 29798702686 966557737 78175604253 84922374374 66149759365 4499380469 17953982120 22738453560 35389367375 71164988711 1...
output:
4385401630265
result:
ok answer is '4385401630265'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
300 0 0 0 7227130 0 44665356632 741540074 3252 1053109 0 0 3343976697 299282315 7 57190829 0 4379965174 17883634737 17400873810 3693 134 144164936555 320312270 0 0 423566 549 0 1979 0 0 0 2462345997 1021629061 483112 0 172597 11 0 0 0 0 3189174969 64832 14166776345 69159 0 0 56330326146 0 1206275174...
output:
2110095119925
result:
ok answer is '2110095119925'
Test #7:
score: 0
Accepted
time: 100ms
memory: 18836kb
input:
1000000 380994485120 380994485121 380994485122 380994485123 380994485124 380994485125 380994485126 380994485127 380994485128 380994485129 380994485130 380994485131 380994485132 380994485133 380994485134 380994485135 380994485136 380994485137 380994485138 380994485139 380994485140 380994485141 380994...
output:
56209236563089050
result:
ok answer is '56209236563089050'
Test #8:
score: 0
Accepted
time: 92ms
memory: 18796kb
input:
999947 694442488933 694442488934 694442488935 694442488936 694442488937 694442488938 694442488939 694442488940 694442488941 694442488942 694442488943 694442488944 694442488945 694442488946 694442488947 694442488948 694442488949 694442488950 694442488951 694442488952 694442488953 694442488954 6944424...
output:
53476040131480818
result:
ok answer is '53476040131480818'
Test #9:
score: 0
Accepted
time: 91ms
memory: 18812kb
input:
999990 622530347171 622530347172 622530347173 622530347174 622530347175 622530347176 622530347177 622530347178 622530347179 622530347180 622530347181 622530347182 622530347183 622530347184 622530347185 622530347186 622530347187 622530347188 622530347189 622530347190 622530347191 622530347192 6225303...
output:
59655875519862620
result:
ok answer is '59655875519862620'
Test #10:
score: 0
Accepted
time: 91ms
memory: 18780kb
input:
999910 116060584011 116060584012 116060584013 116060584014 116060584015 116060584016 116060584017 116060584018 116060584019 116060584020 116060584021 116060584022 116060584023 116060584024 116060584025 116060584026 116060584027 116060584028 116060584029 116060584030 116060584031 116060584032 1160605...
output:
37600735249746864
result:
ok answer is '37600735249746864'
Test #11:
score: 0
Accepted
time: 171ms
memory: 18708kb
input:
999980 973456184999 994679955061 993282175653 986051760436 954528887794 971573107627 996867749843 974175945534 965645059409 948673925746 962475247646 943221827884 987108127588 950169443307 918838723437 973511911195 996442323027 937608082925 997085429522 986532516116 969352518578 945143680447 9986449...
output:
902808284804665118
result:
ok answer is '902808284804665118'
Test #12:
score: 0
Accepted
time: 175ms
memory: 18796kb
input:
999910 981804924069 993068644407 972553472049 997366211901 951558543560 971846343773 813196870765 998061906229 982655806513 930622991527 984343959371 970826388690 995204841006 953323887709 979105600608 923189652758 967575164499 948270918453 976227432556 867116017989 972847233021 981119978185 9396479...
output:
905128344512512150
result:
ok answer is '905128344512512150'
Test #13:
score: 0
Accepted
time: 171ms
memory: 18800kb
input:
999936 25622203424 23487942008 41846404244 4374430937 21910375052 3108899134 20185511495 4455557875 42806661842 56370037380 43364758665 52822782975 34256333894 103004353803 80820299610 10675150544 28850405021 6079651716 3573334559 46743312294 63680217570 30618578145 36920171463 28470905057 904112253...
output:
20164611117398530
result:
ok answer is '20164611117398530'
Test #14:
score: 0
Accepted
time: 170ms
memory: 18776kb
input:
999987 11296929440 3829248220 16110883502 108978342265 2439137426 46560640772 346674808 30554463920 32615816900 54993560414 70317538277 4369646784 70001149917 12270150542 63590841758 32691739830 33277030825 74020183023 49709960612 88388172284 53864086705 8919782253 77173128886 47741816096 3158211906...
output:
17850294803699038
result:
ok answer is '17850294803699038'
Test #15:
score: 0
Accepted
time: 183ms
memory: 18788kb
input:
999950 965451514895 928786263913 995753155457 920660095725 975630178104 936271639198 936597205250 966542858200 975353440835 984130693812 838646587156 928864562822 835106340229 915163790869 965604614865 962450220083 657845241722 987487117331 998737597695 974274620652 920272247043 966117123618 9707261...
output:
840108611551824264
result:
ok answer is '840108611551824264'
Test #16:
score: 0
Accepted
time: 113ms
memory: 18924kb
input:
999994 11487015629 96368587486 51702167159 50716618412 51327709589 31911160521 39369096207 25538663648 130373113724 40961852769 59282165353 10662167580 39124876381 52968321160 45194719247 33547539009 96556439298 48019555217 30123457327 8663212992 11813153788 10999633300 7846446836 40028182342 514380...
output:
135299515549954901
result:
ok answer is '135299515549954901'
Test #17:
score: 0
Accepted
time: 100ms
memory: 18828kb
input:
999996 1073741824 1024 34359738368 137438953472 33554432 8192 1048576 137438953472 1048576 8192 8388608 4096 137438953472 33554432 1048576 274877906944 68719476736 128 8 4 1048576 4294967296 16 1048576 32 67108864 32768 4 32 536870912 1048576 256 17179869184 128 32 16 512 4294967296 549755813888 102...
output:
321034390265803051
result:
ok answer is '321034390265803051'
Test #18:
score: 0
Accepted
time: 111ms
memory: 18888kb
input:
999994 524288 1048576 8388608 8192 137438953472 17179869184 1 2097152 128 2097152 2097152 1024 1048576 2 1024 4 67108864 1073741824 8388608 2097152 536870912 8388608 17179869184 8589934592 68719476736 1048576 4 131072 2147483648 1 137438953472 8589934592 2147483648 34359738368 34359738368 4096 64 13...
output:
235653309942276920
result:
ok answer is '235653309942276920'
Test #19:
score: 0
Accepted
time: 94ms
memory: 18816kb
input:
999991 223551271527 133942442916 86939371421 183143354396 56504348482 64818767951 44264419136 47294191059 117630842464 15542116719 41990448816 78380314341 44386890113 10202071215 64282683242 61622847203 73396150638 154024547476 104165424254 15746486026 13676119224 60672174051 728271404 114542798143 ...
output:
176027867038140096
result:
ok answer is '176027867038140096'
Test #20:
score: 0
Accepted
time: 91ms
memory: 18852kb
input:
999991 16777216 268435456 1073741824 256 4294967296 32768 8388608 8589934592 17179869184 4194304 2097152 1 16384 65536 4096 16384 262144 2097152 34359738368 2147483648 274877906944 1073741824 536870912 34359738368 16777216 524288 256 549755813888 17179869184 34359738368 1 262144 8388608 256 8192 256...
output:
120929680834199012
result:
ok answer is '120929680834199012'
Test #21:
score: 0
Accepted
time: 97ms
memory: 18848kb
input:
1000000 548682072063 515396075519 549755813871 549755682815 515396075519 549755813886 549487378431 274877906943 549739036671 549755813631 549755289599 549755797503 549755811839 515396075519 549755809791 547608330239 541165879295 549755289599 481036337151 549755813885 515396075519 541165879295 549755...
output:
299351539718099798
result:
ok answer is '299351539718099798'
Test #22:
score: 0
Accepted
time: 89ms
memory: 18964kb
input:
1000000 210616201455 105560716790 16447258103 27858186232 208691922336 1125220424 107300867031 29957810501 833957499 308759811 78529621444 122964862323 25132739097 5169180543 106208873201 142490854205 37957832056 36736173813 66961455925 171269557350 18320614333 99679971371 22616443128 23865085226 65...
output:
179490432768376297
result:
ok answer is '179490432768376297'
Test #23:
score: 0
Accepted
time: 103ms
memory: 18812kb
input:
1000000 4388287287 132887244250 53788663362 77970947924 35016181210 18935678174 28902440471 87509896913 58547250753 55871165145 180873100851 65377459162 72815604760 221287226095 32796697184 2709792252 42931188752 157146523595 121034968503 114452324637 14396274986 54548544395 37206383835 175911614482...
output:
236598394308419545
result:
ok answer is '236598394308419545'
Test #24:
score: 0
Accepted
time: 120ms
memory: 18812kb
input:
1000000 549755813871 547608330239 549751619583 549755748351 549487378431 549755682815 549755797503 515396075519 548682072063 549755551743 549747425279 549755813879 549755781119 481036337151 549218942975 549621596159 541165879295 549755813631 549739036671 547608330239 549755781119 549755748351 549739...
output:
472055104408081976
result:
ok answer is '472055104408081976'
Test #25:
score: 0
Accepted
time: 85ms
memory: 18836kb
input:
1000000 820483397150 983141633308 988904085441 975938935104 996789252023 997425580433 999699483311 987577329334 839731757349 762734764182 923129428133 949594906349 990868379739 992169622388 941371255921 925508427272 917584502805 926363401395 948090893308 914545348502 851931396466 979026577192 989758...
output:
255115955188771164
result:
ok answer is '255115955188771164'
Test #26:
score: 0
Accepted
time: 59ms
memory: 18964kb
input:
1000000 547608330239 549755809791 412316860415 532575944703 549755812863 549755813886 549755813823 545460846591 549753716735 549755813883 549755813879 549755809791 549751619583 549755748351 549722259455 549755813883 548682072063 548682072063 549755781119 549755748351 549755781119 549621596159 549218...
output:
520855018228327407
result:
ok answer is '520855018228327407'
Test #27:
score: 0
Accepted
time: 62ms
memory: 18812kb
input:
1000000 8192 16 32768 32 536870912 2097152 1048576 16777216 134217728 134217728 2 1073741824 32768 536870912 8388608 33554432 8192 524288 16384 2 549755813888 8192 256 4 33554432 512 68719476736 16 8 33554432 268435456 17179869184 524288 2048 32768 68719476736 4294967296 32768 16777216 32 4294967296...
output:
15359335635721243
result:
ok answer is '15359335635721243'
Test #28:
score: 0
Accepted
time: 101ms
memory: 18776kb
input:
999993 128 268435456 524288 1048576 2048 34359738368 1024 32 256 65536 1 65536 2097152 2147483648 524288 8192 268435456 4096 16777216 1 8589934592 16384 64 8 2147483648 128 512 33554432 524288 32 512 536870912 549755813888 268435456 65536 2 4294967296 262144 16777216 128 2 262144 34359738368 4096 27...
output:
431782162576124941
result:
ok answer is '431782162576124941'
Test #29:
score: 0
Accepted
time: 76ms
memory: 15484kb
input:
787546 515396075519 547608330239 274877906943 549218942975 549621596159 549755809791 549755813879 549487378431 549755805695 549747425279 549755748351 549755813879 549755813855 515396075519 549755551743 274877906943 549755813631 549755682815 532575944703 549755813886 545460846591 549755811839 5494873...
output:
136324939598900550
result:
ok answer is '136324939598900550'