QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#612717 | #6627. Line Town | zhaohaikun | 25 ✓ | 753ms | 82300kb | C++23 | 4.4kb | 2024-10-05 12:41:15 | 2024-10-05 12:41:16 |
Judging History
answer
// MagicDark
#include <bits/stdc++.h>
#define debug cerr << "\33[32m[" << __LINE__ << "]\33[m "
#define SZ(x) ((int) x.size() - 1)
#define all(x) x.begin(), x.end()
#define ms(x, y) memset(x, y, sizeof x)
#define F(i, x, y) for (int i = (x); i <= (y); i++)
#define DF(i, x, y) for (int i = (x); i >= (y); i--)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
template <typename T> T& chkmax(T& x, T y) {return x = max(x, y);}
template <typename T> T& chkmin(T& x, T y) {return x = min(x, y);}
template <typename T> T& read(T &x) {
x = 0; int f = 1; char c = getchar();
for (; !isdigit(c); c = getchar()) if (c == '-') f = - f;
for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
return x *= f;
}
const int N = 5e5 + 10;
const ll INF = 1e18;
int n, a[N];
ll dp[2];
map <int, vector <int>> mp;
struct BIT {
int t[N], tim[N], cnt;
void modify(int x, int y) {
for (; x <= n; x += x & - x) {
if (tim[x] != cnt) tim[x] = cnt, t[x] = y;
else t[x] += y;
}
}
int query(int x) {
int s = 0;
for (; x; x -= x & - x)
if (tim[x] == cnt) s += t[x];
return s;
}
int query(int l, int r) {
return query(r) - query(l - 1);
}
} ds, op[2];
ll s1[2][N], s2[2][N], r1[N], r2[N];
int w1[N], w2[N];
signed main() {
// freopen("sort.in", "r", stdin);
// freopen("sort.out", "w", stdout);
read(n);
F(i, 1, n) {
mp[- abs(read(a[i]))].push_back(i);
ds.modify(i, 1);
}
dp[1] = INF;
int res = n;
for (auto [a, b]: mp) if (a) {
int A = a;
ll ndp[2];
ndp[0] = ndp[1] = INF;
vector <int> o[2];
for (int i: b) {
o[(i & 1) ^ (::a[i] < 0)].push_back(i);
ds.modify(i, - 1);
}
for (int i: b) {
w1[i] = ds.query(1, i);
w2[i] = ds.query(i, n);
}
F(t, 0, 1) {
s2[t][o[t].size() + 1] = 0;
F(i, 1, o[t].size()) {
s1[t][i] = s1[t][i - 1] + w1[o[t][i - 1]];
}
DF(i, o[t].size(), 1) {
s2[t][i] = s2[t][i + 1] + w2[o[t][i - 1]];
}
}
// in
F(a, 0, 1)
F(b, 0, 1)
F(c, 0, 1)
F(d, 0, 1)
if (o[0].size() + (a == 1 && b == 1) + (c == 1 && d == 1) == o[1].size() + (a == 0 && b == 0) + (c == 0 && d == 0)) {
if (dp[a] != INF && (d ^ a) == (res & 1)) {
// debug << A << " " << a << " " << b << " " << c << " " << d << endl;
{
F(t, 0, 1) op[t].cnt++;
// op.cnt++;
for (int t: o[1]) {
op[1].modify(t, 1);
}
int pos = - 1;
// ll ss = 0;
auto del = [&] () {
pos++;
if (pos <= SZ(o[1])) {
op[0].modify(o[1][pos], 1);
op[1].modify(o[1][pos], - 1);
// pos++;
}
};
if (a) del();
F(t, 1, o[0].size()) {
if (pos <= SZ(o[1])) {
r1[t] = r1[t - 1] + op[0].query(o[0][t - 1], n) + op[1].query(1, o[0][t - 1]);
// op.modify(o[0][t - 1], 1);
} else r1[t] = INF;
del();
}
}
{
F(t, 0, 1) op[t].cnt++;
// op.cnt++;
for (int t: o[1]) {
op[0].modify(t, 1);
}
int pos = SZ(o[1]) + 1;
// ll ss = 0;
auto del = [&] () {
pos--;
if (pos >= 0) {
op[1].modify(o[1][pos], 1);
op[0].modify(o[1][pos], - 1);
// pos--;
}
};
if (d) del();
r2[o[0].size() + 1] = 0;
DF(t, o[0].size(), 1) {
if (pos >= 0) {
r2[t] = r2[t + 1] + op[0].query(o[0][t - 1], n) + op[1].query(1, o[0][t - 1]);
// op.modify(o[0][t - 1], 1);
} else r2[t] = INF;
del();
}
}
F(i, 0, o[0].size()) {
if (a == 0 && b == 0 && i == 0) continue;
if (c == 0 && d == 0 && i == o[0].size()) continue;
// debug << "@ " << r1[i] << " " << r2[i + 1] << endl;
chkmin(ndp[b ^ 1], dp[a] + r1[i] + r2[i + 1] + s1[0][i] + s1[1][i - (a == 0 && b == 0) + (a == 1 && b == 1)] + s2[0][i + 1] + s2[1][i - (a == 0 && b == 0) + (a == 1 && b == 1) + 1]);
}
}
}
res -= b.size();
swap(dp, ndp);
// debug << dp[0] << " " << dp[1] << endl;
// ll ans = min(dp[0], dp[1]);
// if (ans == INF) puts("-1");
// else cout << ans << '\n';
}
ll ans = min(dp[0], dp[1]);
if (ans == INF) puts("-1");
else cout << ans << '\n';
return 0;
}
/* why?
*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 3
Accepted
Test #1:
score: 3
Accepted
time: 0ms
memory: 11816kb
input:
10 1 1 1 1 1 -1 -1 -1 1 -1
output:
-1
result:
ok 1 number(s): "-1"
Test #2:
score: 3
Accepted
time: 3ms
memory: 15860kb
input:
10 1 1 1 1 1 1 -1 1 1 -1
output:
3
result:
ok 1 number(s): "3"
Test #3:
score: 3
Accepted
time: 2ms
memory: 13832kb
input:
1 -1
output:
0
result:
ok 1 number(s): "0"
Test #4:
score: 3
Accepted
time: 0ms
memory: 16008kb
input:
2000 1 -1 -1 -1 -1 -1 1 -1 1 1 1 -1 -1 -1 1 1 -1 1 1 -1 -1 1 -1 -1 1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 1 1 1 -1 1 1 -1 -1 1 -1 1 1 1 1 -1 -1 -1 1 1 -1 -1 1 1 1 -1 -1 -1 -1 1 -1 -1 1 1 -1 1 -1 1 -1 -1 -1 1 -1 -1 ...
output:
15146
result:
ok 1 number(s): "15146"
Test #5:
score: 3
Accepted
time: 0ms
memory: 15940kb
input:
2000 -1 -1 1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 1 1 1 -1 1 1 1 1 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 -1 1 1 1 1 -1 -1 1 -1 -1 1 -1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 1 1 -1 1 1 1 1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 1 -1 1 1 -1 1 1 1 -1 1 1 -1 -1 -1 ...
output:
24933
result:
ok 1 number(s): "24933"
Test #6:
score: 3
Accepted
time: 0ms
memory: 16096kb
input:
2000 1 1 -1 -1 -1 -1 1 1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 1 -1 1 1 -1 1 1 -1 1 1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 1 -1 1 -1 1 1 -1 1 1 1 1 -1 1 1 1 1 -1 -1 1 1 1 -1 1 1 1 1 1 -1 -1 -1 1 1 -1 1 1 -1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 1 -1 -1 1 -...
output:
18090
result:
ok 1 number(s): "18090"
Test #7:
score: 3
Accepted
time: 0ms
memory: 11832kb
input:
2000 -1 -1 -1 -1 -1 1 1 -1 -1 -1 1 1 -1 -1 1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 1 1 -1 1 1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 -1 1 -1 -1 1 1 1 -1 1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 1 -1 1 -1 -1 1 1 1...
output:
-1
result:
ok 1 number(s): "-1"
Test #8:
score: 3
Accepted
time: 3ms
memory: 16184kb
input:
2000 -1 1 -1 1 1 -1 -1 1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 1 1 -1 -1 -1 1 -1 1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 -1 1 1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1 1 -1 1 1 1 1 -1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 1 -1 -1 -1 ...
output:
9973
result:
ok 1 number(s): "9973"
Test #9:
score: 3
Accepted
time: 0ms
memory: 16168kb
input:
2000 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 ...
output:
499500
result:
ok 1 number(s): "499500"
Test #10:
score: 3
Accepted
time: 0ms
memory: 15908kb
input:
2000 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
499500
result:
ok 1 number(s): "499500"
Test #11:
score: 3
Accepted
time: 0ms
memory: 15864kb
input:
1999 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
499500
result:
ok 1 number(s): "499500"
Test #12:
score: 3
Accepted
time: 0ms
memory: 15904kb
input:
1997 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
498501
result:
ok 1 number(s): "498501"
Test #13:
score: 3
Accepted
time: 2ms
memory: 11780kb
input:
2000 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
-1
result:
ok 1 number(s): "-1"
Subtask #2:
score: 3
Accepted
Dependency #1:
100%
Accepted
Test #14:
score: 3
Accepted
time: 0ms
memory: 15824kb
input:
1 1
output:
0
result:
ok 1 number(s): "0"
Test #15:
score: 3
Accepted
time: 72ms
memory: 47288kb
input:
500000 1 -1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 -1 -1 1 -1 1 1 -1 1 -1 1 1 1 -1 -1 1 -1 1 1 1 1 1 -1 -1 -1 1 -1 1 1 1 1 1 1 1 -1 -1 1 1 -1 1 1 1 -1 1 -1 1 1 -1 -1 1 -1 -1 -1 1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 1 1 -1 1 1 1 1 1 1 1 1 1 -1 1 1 1 -1 -1 -1 1 -1 1 -1 1 1 1 1 -1 1 -1 -1 1 1 -1 1 1 1 1 -1 1 1 -1 -1 1 ...
output:
29737766
result:
ok 1 number(s): "29737766"
Test #16:
score: 3
Accepted
time: 70ms
memory: 47156kb
input:
500000 1 -1 -1 1 1 1 1 1 1 1 1 1 -1 1 -1 -1 1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 1 -1 1 -1 -1 1 -1 -1 1 -1 1 1 1 1 -1 1 -1 1 -1 1 1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 1 -1 1 1 1 1 -1 1 1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1...
output:
66957355
result:
ok 1 number(s): "66957355"
Test #17:
score: 3
Accepted
time: 87ms
memory: 48968kb
input:
500000 1 -1 1 1 1 -1 1 1 -1 1 1 1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 -1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 -1 -1 1 1 1 1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 1 -1 1 1 -1 -1 1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 -1 1...
output:
50480873
result:
ok 1 number(s): "50480873"
Test #18:
score: 3
Accepted
time: 26ms
memory: 31504kb
input:
500000 -1 1 1 -1 1 1 -1 1 1 -1 1 1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 -1 -1 1 1 -1 -1 1 1 -1 1 1 1 -1 1 1 -1 1 1 -1 1 1 -1 1 1 1 1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 -1 -1 1 -1 1 -1 1 -1 -1 1 1 1 -1 1 -1 1 -1 1 1 1 1 1 -1 1 -1 1 1 1 -1 -1 -1 -1...
output:
-1
result:
ok 1 number(s): "-1"
Test #19:
score: 3
Accepted
time: 64ms
memory: 45272kb
input:
500000 1 1 1 1 -1 -1 -1 1 -1 1 1 -1 -1 1 1 1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 1 -1 1 -1 1 -1 1 -1 1 1 -1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 1 1 -1 -1 -1 -1 -1 1 1 1 -1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 1 1 -1 -1 -1 1 1 1 -1 1 1 1 1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 1 1 1 1 -1 -1 -1 -1 1 1 -1 1 1 1...
output:
90473670
result:
ok 1 number(s): "90473670"
Test #20:
score: 3
Accepted
time: 50ms
memory: 42124kb
input:
500000 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
31249875000
result:
ok 1 number(s): "31249875000"
Test #21:
score: 3
Accepted
time: 58ms
memory: 42332kb
input:
500000 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -...
output:
31249875000
result:
ok 1 number(s): "31249875000"
Test #22:
score: 3
Accepted
time: 59ms
memory: 45308kb
input:
499999 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -...
output:
31249875000
result:
ok 1 number(s): "31249875000"
Test #23:
score: 3
Accepted
time: 64ms
memory: 42904kb
input:
499997 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
31249375003
result:
ok 1 number(s): "31249375003"
Test #24:
score: 3
Accepted
time: 26ms
memory: 36072kb
input:
500000 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -...
output:
-1
result:
ok 1 number(s): "-1"
Subtask #3:
score: 3
Accepted
Dependency #1:
100%
Accepted
Test #25:
score: 3
Accepted
time: 0ms
memory: 16128kb
input:
10 0 1 0 0 1 1 -1 0 1 -1
output:
9
result:
ok 1 number(s): "9"
Test #26:
score: 3
Accepted
time: 0ms
memory: 16136kb
input:
10 -1 1 0 0 1 0 -1 0 1 -1
output:
10
result:
ok 1 number(s): "10"
Test #27:
score: 3
Accepted
time: 0ms
memory: 5568kb
input:
1 0
output:
0
result:
ok 1 number(s): "0"
Test #28:
score: 3
Accepted
time: 0ms
memory: 16188kb
input:
2000 0 1 -1 -1 1 1 0 1 0 -1 0 0 0 1 0 -1 1 0 -1 1 1 0 0 1 0 -1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 -1 -1 -1 -1 0 0 0 0 0 1 -1 0 0 0 1 -1 0 0 -1 0 -1 0 1 1 -1 0 -1 0 -1 0 0 -1 1 1 -1 0 0 0 0 -1 -1 1 -1 0 0 0 0 0 -1 0 -1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 1 -1 0 -1 1 1 1 1 0 1 1 0 0 1 0 1 0 -1 -1 0 0 -1 -1...
output:
252956
result:
ok 1 number(s): "252956"
Test #29:
score: 3
Accepted
time: 0ms
memory: 15984kb
input:
2000 1 0 1 -1 -1 1 -1 0 -1 0 -1 1 0 0 -1 1 0 0 -1 0 0 0 -1 -1 0 0 0 0 0 -1 0 0 0 1 0 0 -1 1 1 1 0 1 1 1 0 -1 -1 1 1 1 1 0 -1 1 0 1 0 0 0 0 -1 1 -1 -1 -1 0 0 0 -1 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 -1 0 0 0 -1 0 0 -1 0 -1 0 -1 0 0 1 -1 1 0 0 0 0 0 1 0 0 -1 0 1 0 0 1 1 -1 1 0 0 0 0 -1 0 -1 0 -1 0 0...
output:
262836
result:
ok 1 number(s): "262836"
Test #30:
score: 3
Accepted
time: 0ms
memory: 16212kb
input:
2000 -1 1 1 0 0 0 0 1 0 -1 1 -1 1 0 1 0 1 0 0 1 0 0 -1 -1 0 0 1 0 1 0 -1 0 0 0 0 0 1 0 1 -1 1 0 -1 -1 1 0 -1 0 1 1 -1 0 -1 0 0 -1 1 1 0 -1 -1 0 -1 0 0 0 1 0 -1 -1 -1 0 -1 0 1 1 0 -1 0 -1 1 0 -1 0 -1 1 0 0 1 -1 0 0 0 0 0 0 0 0 -1 0 0 -1 0 -1 1 0 0 0 0 -1 0 1 0 -1 -1 1 -1 0 0 1 -1 -1 -1 1 1 0 -1 0 0 0...
output:
259619
result:
ok 1 number(s): "259619"
Test #31:
score: 3
Accepted
time: 2ms
memory: 11852kb
input:
2000 -1 -1 1 0 0 0 -1 0 0 -1 -1 0 -1 0 -1 0 1 0 0 1 0 0 0 -1 0 0 -1 1 0 1 0 -1 1 -1 -1 -1 -1 0 0 1 0 0 0 -1 0 -1 0 0 1 -1 0 0 0 1 0 0 0 1 0 0 0 1 0 -1 -1 0 1 0 1 -1 -1 -1 1 1 0 1 -1 -1 0 1 0 0 0 0 0 0 -1 -1 0 -1 -1 0 -1 -1 1 1 1 -1 1 0 0 0 1 -1 -1 0 -1 -1 0 0 0 -1 0 1 0 0 0 0 0 -1 0 0 -1 0 -1 0 -1 -...
output:
-1
result:
ok 1 number(s): "-1"
Test #32:
score: 3
Accepted
time: 0ms
memory: 15952kb
input:
1999 -1 1 1 0 -1 -1 0 1 0 0 1 0 -1 1 -1 1 0 1 1 -1 1 -1 -1 0 1 -1 -1 1 0 1 -1 0 -1 -1 -1 -1 1 0 -1 0 -1 1 -1 1 1 0 -1 -1 -1 0 0 1 -1 0 -1 1 1 -1 1 -1 -1 -1 1 1 0 0 0 1 -1 -1 1 1 0 0 1 -1 -1 0 -1 1 -1 1 -1 0 0 -1 0 0 1 -1 0 0 0 1 -1 -1 1 -1 -1 1 0 1 1 1 -1 -1 1 1 0 1 1 1 0 -1 -1 0 -1 0 0 1 1 0 -1 -1 ...
output:
216714
result:
ok 1 number(s): "216714"
Test #33:
score: 3
Accepted
time: 0ms
memory: 16164kb
input:
2000 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 ...
output:
499500
result:
ok 1 number(s): "499500"
Test #34:
score: 3
Accepted
time: 0ms
memory: 13948kb
input:
2000 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
624750
result:
ok 1 number(s): "624750"
Test #35:
score: 3
Accepted
time: 0ms
memory: 16180kb
input:
2000 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 ...
output:
624249
result:
ok 1 number(s): "624249"
Test #36:
score: 3
Accepted
time: 2ms
memory: 11760kb
input:
1998 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 ...
output:
-1
result:
ok 1 number(s): "-1"
Test #37:
score: 3
Accepted
time: 0ms
memory: 11832kb
input:
1999 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 ...
output:
-1
result:
ok 1 number(s): "-1"
Test #38:
score: 3
Accepted
time: 0ms
memory: 15988kb
input:
1999 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
666333
result:
ok 1 number(s): "666333"
Test #39:
score: 3
Accepted
time: 0ms
memory: 16188kb
input:
2000 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
666333
result:
ok 1 number(s): "666333"
Test #40:
score: 3
Accepted
time: 0ms
memory: 15848kb
input:
1999 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
222111
result:
ok 1 number(s): "222111"
Test #41:
score: 3
Accepted
time: 1ms
memory: 5600kb
input:
2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok 1 number(s): "0"
Test #42:
score: 3
Accepted
time: 2ms
memory: 11816kb
input:
1910 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
-1
result:
ok 1 number(s): "-1"
Test #43:
score: 3
Accepted
time: 0ms
memory: 13844kb
input:
2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
572
result:
ok 1 number(s): "572"
Subtask #4:
score: 4
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Test #44:
score: 4
Accepted
time: 76ms
memory: 36908kb
input:
500000 1 1 -1 0 0 -1 1 -1 0 0 1 1 -1 -1 -1 1 -1 1 0 0 -1 1 1 0 0 0 0 0 1 0 -1 0 -1 1 1 0 0 -1 1 0 0 0 0 0 -1 0 0 -1 1 1 0 0 1 0 0 1 -1 0 1 0 0 0 0 -1 1 0 1 0 -1 0 -1 1 1 0 -1 0 0 0 0 0 0 1 -1 1 -1 1 0 1 -1 0 1 -1 0 -1 -1 1 1 0 1 0 -1 0 0 0 -1 0 -1 0 0 1 -1 1 0 0 1 0 1 0 1 0 0 -1 0 1 1 -1 -1 0 0 -1 -...
output:
15602272809
result:
ok 1 number(s): "15602272809"
Test #45:
score: 4
Accepted
time: 58ms
memory: 38608kb
input:
500000 0 0 1 1 0 -1 1 0 -1 0 0 -1 0 -1 1 -1 0 0 1 0 -1 0 0 0 -1 -1 0 0 0 0 -1 1 0 0 0 -1 0 -1 0 -1 -1 0 0 -1 0 0 1 0 1 0 -1 0 1 1 1 1 0 0 1 0 0 0 -1 1 1 0 -1 1 0 -1 0 1 1 1 1 0 0 0 1 0 1 1 0 -1 -1 0 -1 1 1 -1 1 0 0 1 -1 1 -1 -1 0 0 0 0 1 0 1 1 0 0 0 1 0 -1 1 -1 1 1 0 -1 0 1 -1 -1 0 1 0 0 0 0 -1 0 0 ...
output:
15694076101
result:
ok 1 number(s): "15694076101"
Test #46:
score: 4
Accepted
time: 56ms
memory: 36556kb
input:
500000 1 1 0 -1 1 1 -1 0 0 0 0 1 1 0 0 1 1 -1 0 0 1 1 -1 0 0 -1 -1 -1 0 0 0 0 1 -1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 1 0 0 0 -1 -1 1 0 -1 0 0 1 0 1 -1 1 -1 1 0 0 -1 0 0 0 -1 -1 0 -1 0 1 -1 0 0 1 -1 0 1 1 1 0 1 0 0 0 0 0 0 -1 1 -1 0 0 0 1 0 1 -1 -1 1 -1 1 0 -1 0 0 0 0 0 0 0 -1 0 1 -1 1 1 0 0 0 -1 0 0 1 0 0...
output:
15625336308
result:
ok 1 number(s): "15625336308"
Test #47:
score: 4
Accepted
time: 23ms
memory: 27712kb
input:
500000 -1 1 0 0 -1 0 0 -1 0 1 0 -1 0 1 0 -1 1 -1 0 1 0 0 0 0 1 0 -1 0 0 -1 0 -1 1 0 -1 1 -1 0 1 -1 1 0 1 0 0 -1 -1 1 -1 1 0 0 -1 0 -1 0 0 0 0 1 0 0 0 0 0 0 -1 0 0 -1 -1 0 0 0 0 -1 -1 0 0 0 -1 0 1 -1 1 0 1 -1 0 0 -1 0 0 -1 0 1 -1 -1 0 0 1 -1 -1 -1 0 0 -1 -1 -1 -1 0 1 1 0 0 -1 1 0 -1 0 -1 0 1 0 0 0 -1...
output:
-1
result:
ok 1 number(s): "-1"
Test #48:
score: 4
Accepted
time: 92ms
memory: 43404kb
input:
499999 -1 0 -1 -1 -1 0 1 -1 1 1 1 0 1 1 -1 -1 -1 1 0 0 1 1 0 0 1 -1 1 0 -1 1 0 1 0 0 1 0 -1 1 1 1 -1 -1 1 -1 0 1 -1 0 1 -1 1 -1 0 0 -1 -1 -1 -1 -1 0 1 1 -1 -1 1 0 -1 -1 1 -1 -1 0 -1 0 0 0 0 -1 -1 0 1 1 0 -1 1 1 1 1 1 0 1 -1 1 -1 0 1 0 0 -1 0 1 1 -1 0 1 -1 0 -1 0 -1 -1 -1 -1 1 -1 1 1 -1 0 -1 -1 0 0 1...
output:
13935079333
result:
ok 1 number(s): "13935079333"
Test #49:
score: 4
Accepted
time: 55ms
memory: 44912kb
input:
500000 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
31249875000
result:
ok 1 number(s): "31249875000"
Test #50:
score: 4
Accepted
time: 31ms
memory: 34236kb
input:
500000 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -...
output:
39062437500
result:
ok 1 number(s): "39062437500"
Test #51:
score: 4
Accepted
time: 41ms
memory: 36056kb
input:
499998 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
39061937499
result:
ok 1 number(s): "39061937499"
Test #52:
score: 4
Accepted
time: 40ms
memory: 36420kb
input:
500000 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
39062312499
result:
ok 1 number(s): "39062312499"
Test #53:
score: 4
Accepted
time: 18ms
memory: 23712kb
input:
499999 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
-1
result:
ok 1 number(s): "-1"
Test #54:
score: 4
Accepted
time: 60ms
memory: 37524kb
input:
499999 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -...
output:
41666583333
result:
ok 1 number(s): "41666583333"
Test #55:
score: 4
Accepted
time: 35ms
memory: 36048kb
input:
499999 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 ...
output:
41666250001
result:
ok 1 number(s): "41666250001"
Test #56:
score: 4
Accepted
time: 57ms
memory: 38752kb
input:
500000 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -...
output:
13888861111
result:
ok 1 number(s): "13888861111"
Test #57:
score: 4
Accepted
time: 4ms
memory: 13016kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok 1 number(s): "0"
Test #58:
score: 4
Accepted
time: 11ms
memory: 20448kb
input:
499100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
212037
result:
ok 1 number(s): "212037"
Test #59:
score: 4
Accepted
time: 7ms
memory: 21496kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
252209
result:
ok 1 number(s): "252209"
Subtask #5:
score: 4
Accepted
Test #60:
score: 4
Accepted
time: 3ms
memory: 15836kb
input:
10 3 10 5 -9 7 2 -6 1 8 0
output:
-1
result:
ok 1 number(s): "-1"
Test #61:
score: 4
Accepted
time: 0ms
memory: 15792kb
input:
10 -9 0 -1 7 5 10 6 3 2 -8
output:
13
result:
ok 1 number(s): "13"
Test #62:
score: 4
Accepted
time: 0ms
memory: 16068kb
input:
2000 40667 -598150 -1084780 1201651 1570514 -1859539 -2029075 2941581 -2945945 3038404 3447919 5293872 -5335692 -5669647 5973784 6041345 6346915 -7222112 8820986 -9153143 9563103 9749206 -9894732 -11847193 11987150 12161864 13336572 13528051 -13722732 -13836176 -15497141 -15841563 15862227 16618123 ...
output:
-1
result:
ok 1 number(s): "-1"
Test #63:
score: 4
Accepted
time: 3ms
memory: 14128kb
input:
2000 3038404 -798315545 693574695 172661079 516504064 164016456 193562146 -131746730 382134316 -398886978 188767854 -834289064 -965673210 -826409444 -281381674 450991903 -592752625 81651101 -594873306 -352059270 -651772982 540062674 -769881300 68999588 307151563 -129950325 550154987 354801227 840540...
output:
658039
result:
ok 1 number(s): "658039"
Test #64:
score: 4
Accepted
time: 3ms
memory: 16116kb
input:
2000 -1095 -925 -1049 -1519 951 -1673 -776 345 -38 -1735 -276 -1730 123 -1629 -1896 -1576 -1115 1145 15 797 -948 287 1487 1195 1269 -1240 -1571 -275 -1915 -369 -1221 -1590 -1392 -100 1688 -1287 -241 1130 -1375 -965 669 -147 -307 -795 -1207 1939 120 -305 -915 -1078 -1448 1458 -603 1935 658 774 1471 7...
output:
668545
result:
ok 1 number(s): "668545"
Test #65:
score: 4
Accepted
time: 4ms
memory: 16096kb
input:
2000 1290 1487 -1947 -255 457 -1202 1313 36 -1511 898 1739 987 1809 -1986 -1015 -1127 -703 -223 179 557 199 349 1099 -259 -1401 -1244 -1116 646 -295 1713 1512 127 -1660 343 -1921 -1326 -549 831 1963 -1743 1655 -698 1792 366 1517 -51 404 -1853 -1295 1652 -130 -1562 -1850 -582 1504 1888 822 -24 1807 9...
output:
663841
result:
ok 1 number(s): "663841"
Test #66:
score: 4
Accepted
time: 0ms
memory: 16096kb
input:
2000 56 -1667 -1636 -671 -1311 348 976 1381 -710 -477 -1301 756 -510 495 -1215 -278 1134 950 59 1739 -33 -839 -862 605 761 827 -1708 -1180 -607 1624 -120 -1198 624 -1237 -1874 1788 1005 -331 1266 -467 -1213 1736 -182 594 775 1209 -832 300 1188 -994 -191 -217 1360 -1907 71 436 1294 -590 913 -747 -629...
output:
667052
result:
ok 1 number(s): "667052"
Test #67:
score: 4
Accepted
time: 0ms
memory: 16120kb
input:
1999 -758656 -113741 -374719 7680 -227905 -201318 -200890 -84484 777096 -167712 -126972 -244117 835074 161027 923025 -224756 973701 36622 -913757 -920737 -976062 461264 147694 -162457 358437 -308202 385370 808271 -523703 -303454 -522131 -664739 -505124 306509 948216 948694 -467953 -768055 769796 486...
output:
675957
result:
ok 1 number(s): "675957"
Test #68:
score: 4
Accepted
time: 1ms
memory: 5648kb
input:
1 0
output:
0
result:
ok 1 number(s): "0"
Test #69:
score: 4
Accepted
time: 1ms
memory: 9684kb
input:
2 1000000000 999999999
output:
-1
result:
ok 1 number(s): "-1"
Test #70:
score: 4
Accepted
time: 0ms
memory: 16120kb
input:
2000 999998002 999998004 999998006 999998008 999998010 999998012 999998014 999998016 999998018 999998020 999998022 999998024 999998026 999998028 999998030 999998032 999998034 999998036 999998038 999998040 999998042 999998044 999998046 999998048 999998050 999998052 999998054 999998056 999998058 99999...
output:
999000
result:
ok 1 number(s): "999000"
Test #71:
score: 4
Accepted
time: 3ms
memory: 16176kb
input:
1999 -1000000000 -999012346 -998024692 -997037038 -996049384 -995061730 -994074076 -993086422 -992098768 -991111114 -990123460 -989135806 -988148152 -987160498 -986172844 -985185190 -984197536 -983209882 -982222228 -981234574 -980246920 -979259266 -978271612 -977283958 -976296304 -975308650 -9743209...
output:
0
result:
ok 1 number(s): "0"
Test #72:
score: 4
Accepted
time: 0ms
memory: 14340kb
input:
1999 1998 1997 1996 1995 1994 1993 1992 1991 1990 1989 1988 1987 1986 1985 1984 1983 1982 1981 1980 1979 1978 1977 1976 1975 1974 1973 1972 1971 1970 1969 1968 1967 1966 1965 1964 1963 1962 1961 1960 1959 1958 1957 1956 1955 1954 1953 1952 1951 1950 1949 1948 1947 1946 1945 1944 1943 1942 1941 1940 ...
output:
1998
result:
ok 1 number(s): "1998"
Subtask #6:
score: 3
Accepted
Dependency #5:
100%
Accepted
Test #73:
score: 3
Accepted
time: 184ms
memory: 72544kb
input:
500000 -725 2759 -4173 -4473 4578 -5071 -7897 -7991 9738 -12600 17445 -18596 -20105 -21103 22718 26116 -26973 33169 -33830 34895 37480 -41216 -41665 43933 44687 45286 -46096 46958 47293 -50534 50597 -52520 -57079 57680 58680 -62109 63682 -64495 -64608 64674 -64848 -65420 67176 -74442 -76904 -77098 -...
output:
-1
result:
ok 1 number(s): "-1"
Test #74:
score: 3
Accepted
time: 752ms
memory: 80800kb
input:
500000 716212992 819699933 394255912 695521313 788446410 -466519569 476323400 812543029 724100006 -681244028 -306686799 216473950 496416101 636791486 302599115 190055737 -908659874 -407112922 733684038 -282369420 36611820 323272468 -755065727 -735846631 -22777612 905154351 -694170466 -726666701 7098...
output:
41671567967
result:
ok 1 number(s): "41671567967"
Test #75:
score: 3
Accepted
time: 730ms
memory: 81592kb
input:
500000 -207438 355273 -248123 -19764 185461 162549 -188348 52382 490160 -462312 -44831 -465995 -499994 -43101 -250302 46616 -299265 -249140 383722 -165273 213956 256256 -77000 360942 128116 -376727 -496619 100239 -264529 148062 -435402 -1754 -58897 -473213 469221 -155309 112961 -346627 -296763 -4248...
output:
41688628365
result:
ok 1 number(s): "41688628365"
Test #76:
score: 3
Accepted
time: 735ms
memory: 82240kb
input:
500000 446009 -206999 332464 418913 406238 362645 -398832 101718 476481 97209 16149 -32080 210518 98993 151207 150280 -465090 -481536 201273 -421543 126547 307562 390250 -352233 -297858 -139422 239902 347062 209365 -202318 -124062 209464 241668 -132664 323247 -258834 401172 -466622 -482207 197967 -4...
output:
41663196994
result:
ok 1 number(s): "41663196994"
Test #77:
score: 3
Accepted
time: 728ms
memory: 82148kb
input:
500000 326709 73487 -462901 -247992 -233542 51555 -292893 -379042 397932 -114616 482840 43601 -51534 -182229 -90626 8113 -350602 -9122 -113219 439803 177 370081 -374799 62644 -438795 350357 -148565 453075 -124099 15381 73618 75602 -490979 307811 225874 -65426 -87170 -163734 -392827 436432 402025 252...
output:
41656112780
result:
ok 1 number(s): "41656112780"
Test #78:
score: 3
Accepted
time: 746ms
memory: 82236kb
input:
499999 -6051333 -9732801 3294558 -6403019 -7017102 -9707201 -6061284 -5691041 6049033 8228170 3461230 9448399 5524454 -2197488 -7940006 -1350303 493335 -5456003 1090695 -2008109 -3237925 3617186 6998401 -3574218 999525 -426659 5779982 4786849 5638317 9889583 -6084486 -9252364 -5377778 8297232 545487...
output:
41726273087
result:
ok 1 number(s): "41726273087"
Test #79:
score: 3
Accepted
time: 0ms
memory: 14008kb
input:
1 1000000000
output:
0
result:
ok 1 number(s): "0"
Test #80:
score: 3
Accepted
time: 0ms
memory: 11720kb
input:
2 0 -1000000000
output:
-1
result:
ok 1 number(s): "-1"
Test #81:
score: 3
Accepted
time: 218ms
memory: 82272kb
input:
500000 999500002 999500004 999500006 999500008 999500010 999500012 999500014 999500016 999500018 999500020 999500022 999500024 999500026 999500028 999500030 999500032 999500034 999500036 999500038 999500040 999500042 999500044 999500046 999500048 999500050 999500052 999500054 999500056 999500058 999...
output:
62499750000
result:
ok 1 number(s): "62499750000"
Test #82:
score: 3
Accepted
time: 231ms
memory: 79252kb
input:
499999 -1000000000 -999996544 -999993088 -999989632 -999986176 -999982720 -999979264 -999975808 -999972352 -999968896 -999965440 -999961984 -999958528 -999955072 -999951616 -999948160 -999944704 -999941248 -999937792 -999934336 -999930880 -999927424 -999923968 -999920512 -999917056 -999913600 -99991...
output:
0
result:
ok 1 number(s): "0"
Test #83:
score: 3
Accepted
time: 242ms
memory: 82300kb
input:
499999 499998 499997 499996 499995 499994 499993 499992 499991 499990 499989 499988 499987 499986 499985 499984 499983 499982 499981 499980 499979 499978 499977 499976 499975 499974 499973 499972 499971 499970 499969 499968 499967 499966 499965 499964 499963 499962 499961 499960 499959 499958 499957...
output:
499998
result:
ok 1 number(s): "499998"
Subtask #7:
score: 2
Accepted
Dependency #3:
100%
Accepted
Dependency #5:
100%
Accepted
Test #84:
score: 2
Accepted
time: 0ms
memory: 12024kb
input:
2000 -712201807 395965214 845681334 619140248 -741521072 786758881 340213356 -529678837 151707945 327004454 573017024 857965513 -228724921 269122643 961412211 667206872 176451853 628862351 419556721 216401822 -81893212 370970708 -754083788 -883551608 769103150 -603735408 -236144544 -723728591 -19482...
output:
-1
result:
ok 1 number(s): "-1"
Test #85:
score: 2
Accepted
time: 0ms
memory: 14024kb
input:
2000 -207917358 485615334 -706126810 -789660519 629725168 827892248 779265824 560233861 524664590 -393783284 -440021768 315070450 -622473794 489263733 413058741 -593246618 -488814480 840858074 -253700822 353505297 -309466571 -65528378 -1397378 924732667 -528400461 605642479 -516602518 -22775794 8683...
output:
657375
result:
ok 1 number(s): "657375"
Test #86:
score: 2
Accepted
time: 0ms
memory: 16080kb
input:
2000 645 -1877 1717 677 499 387 -1914 -1986 -1705 -1832 275 1799 727 -831 -1132 984 1907 -1193 -514 -1006 -846 1480 -1517 774 563 -187 1178 1044 -1952 -605 1427 -1438 -122 -1371 677 138 -1590 112 -1936 -1033 -703 -281 80 263 -581 -70 209 -837 356 -931 790 666 19 168 -1201 -148 473 1656 -566 -114 -15...
output:
620136
result:
ok 1 number(s): "620136"
Test #87:
score: 2
Accepted
time: 0ms
memory: 15936kb
input:
2000 91 149 -136 -180 -48 15 149 44 45 38 193 -12 -70 61 -174 30 76 -64 -39 -95 115 -150 191 40 19 -179 -8 -171 -7 119 116 -160 172 -167 -26 -111 158 8 -91 -118 -36 -48 -3 -81 -150 190 59 115 -130 133 -97 -129 -125 -154 173 -43 101 -65 90 82 -47 -97 -33 14 98 -116 -138 15 -157 -161 -128 -124 -53 144...
output:
526542
result:
ok 1 number(s): "526542"
Test #88:
score: 2
Accepted
time: 0ms
memory: 15928kb
input:
2000 18 1 -12 4 13 -8 5 -17 0 16 19 -18 16 16 6 -14 13 -2 -10 -8 1 17 18 -5 -14 -15 2 -2 6 20 -7 -4 -15 -9 16 -20 -19 3 -6 1 -8 -1 4 -10 -13 13 -17 5 -17 -11 9 3 19 -7 17 11 3 1 -19 17 20 9 1 -8 5 -2 0 -3 -18 6 -15 -17 16 19 -15 -9 -4 2 -19 20 -1 -6 -13 -9 13 10 10 0 -11 -13 -14 -20 1 -12 18 -13 -1 ...
output:
473295
result:
ok 1 number(s): "473295"
Test #89:
score: 2
Accepted
time: 2ms
memory: 13932kb
input:
2000 0 -2 2 2 -2 2 2 0 1 1 2 1 2 2 -2 0 2 -2 0 0 0 2 0 1 2 0 -2 2 0 0 0 -2 2 2 1 2 2 -2 -2 -2 2 -1 -2 0 1 1 -1 -2 1 2 0 0 -1 1 2 0 -1 0 -2 -2 1 0 1 2 0 2 -1 0 1 0 -1 -2 -2 1 -1 2 -1 -1 0 2 2 -1 1 1 0 -1 0 1 -1 0 0 2 0 -2 2 2 0 -1 0 -1 -2 1 0 0 1 -2 -2 -1 -2 -1 -2 0 2 -1 -1 0 0 2 0 -2 2 0 2 -2 0 1 0 ...
output:
336502
result:
ok 1 number(s): "336502"
Test #90:
score: 2
Accepted
time: 0ms
memory: 16192kb
input:
2000 2 1 0 0 2 1 0 -2 0 -2 0 -1 0 -1 1 2 2 0 0 -2 0 2 1 1 2 0 0 1 1 0 -1 0 0 2 2 1 0 -2 0 -2 2 0 -2 1 0 -1 -2 -2 2 2 -1 -1 2 1 1 -2 1 1 -2 -1 -1 2 0 -2 0 -2 0 0 2 0 -2 -2 -2 -2 0 0 -2 0 2 0 0 0 0 0 0 0 2 -2 0 2 2 0 -1 -1 -1 0 -1 -1 -2 -1 -1 -1 0 1 0 1 0 0 -2 1 0 1 1 -2 -1 0 -2 0 0 0 2 0 2 0 2 2 0 0 ...
output:
330798
result:
ok 1 number(s): "330798"
Test #91:
score: 2
Accepted
time: 0ms
memory: 15964kb
input:
2000 0 1 -2 0 0 -1 1 0 -1 2 0 2 -1 1 0 1 0 1 2 2 -2 0 -2 0 0 0 -1 0 1 -2 -2 0 -1 0 -2 0 2 0 -2 -2 2 0 -2 0 -2 2 2 0 0 0 0 0 2 2 0 -2 1 2 2 0 0 1 2 2 -1 0 -2 1 -1 -2 0 -2 -2 0 -2 -1 0 2 -1 0 1 1 0 1 -1 1 -2 2 2 2 -1 2 -2 2 -1 1 -1 -1 0 1 1 -1 0 0 2 -1 0 0 1 -2 2 2 -1 -2 1 -2 0 -2 0 -2 0 0 0 -2 0 -1 1...
output:
329241
result:
ok 1 number(s): "329241"
Test #92:
score: 2
Accepted
time: 0ms
memory: 16392kb
input:
2000 0 0 0 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 ...
output:
998998
result:
ok 1 number(s): "998998"
Test #93:
score: 2
Accepted
time: 0ms
memory: 15856kb
input:
2000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000...
output:
666333
result:
ok 1 number(s): "666333"
Subtask #8:
score: 3
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #7:
100%
Accepted
Test #94:
score: 3
Accepted
time: 110ms
memory: 39796kb
input:
500000 0 0 0 0 1 1 0 0 0 -1 0 -2 0 -2 1 1 -1 0 2 1 0 -1 -1 -1 1 -2 0 0 -2 0 -1 2 0 0 1 0 2 0 0 0 1 0 1 0 1 0 -2 0 -2 1 1 2 0 -2 -1 -2 -1 -2 -2 1 0 0 2 -2 -2 1 0 -2 2 -1 -2 2 2 1 1 -1 0 0 2 0 0 -2 0 0 1 0 0 -1 0 0 -1 1 -2 -2 0 0 1 -1 2 -2 -1 2 0 0 1 -1 0 2 -2 0 2 2 0 0 -1 -2 1 0 0 2 0 -2 1 1 2 0 1 -2...
output:
20836704913
result:
ok 1 number(s): "20836704913"
Test #95:
score: 3
Accepted
time: 144ms
memory: 33196kb
input:
500000 1 2 1 0 0 -2 0 1 -1 -1 1 -2 1 -1 0 0 0 2 -2 -1 -2 0 2 -1 0 1 0 2 -2 0 0 -2 0 -1 2 -2 -1 0 0 -1 1 -1 2 0 0 -1 -2 1 -1 0 0 0 -1 -1 -1 -2 -2 0 0 -2 -2 1 0 -2 -1 1 0 -2 -1 -1 0 -1 -1 -1 1 -1 -2 1 -2 1 2 0 0 0 0 2 0 -1 1 -1 -1 -2 -1 2 1 0 0 -2 -1 0 -1 1 0 2 -2 0 -1 0 1 1 2 -2 1 -2 2 1 1 -1 1 -1 -1...
output:
20863666644
result:
ok 1 number(s): "20863666644"
Test #96:
score: 3
Accepted
time: 70ms
memory: 35544kb
input:
500000 2 1 2 0 0 2 -1 -1 0 0 -1 2 -1 1 0 -2 -1 1 0 0 2 -2 1 0 2 0 -2 1 0 0 2 -2 0 0 0 1 -1 0 -2 -1 1 1 1 1 1 2 2 0 2 0 -1 0 -2 2 0 1 -1 0 -1 -1 -1 2 -2 0 0 -1 0 0 2 2 0 -1 0 1 -1 2 1 1 0 -1 1 -1 2 0 0 0 2 1 1 -1 1 1 1 -1 -1 0 0 -1 0 2 0 -2 0 1 0 0 2 2 0 1 1 0 -2 0 0 2 -1 1 -1 0 -1 1 -2 -1 -2 -1 0 2 ...
output:
20826693254
result:
ok 1 number(s): "20826693254"
Test #97:
score: 3
Accepted
time: 224ms
memory: 79224kb
input:
500000 0 0 0 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 17...
output:
62499749998
result:
ok 1 number(s): "62499749998"
Test #98:
score: 3
Accepted
time: 56ms
memory: 34604kb
input:
500000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -10000...
output:
41666583333
result:
ok 1 number(s): "41666583333"
Test #99:
score: 3
Accepted
time: 638ms
memory: 72460kb
input:
500000 852920942 -208321849 -177538790 -370461680 532393639 745905889 809289848 763120464 527884531 800971089 -190247239 204417665 -615568752 829364371 799201821 -172055794 863778980 165111166 530825559 -277623877 -974308653 -147189634 -134355815 -331221162 -849677263 162975528 12173992 679982441 14...
output:
-1
result:
ok 1 number(s): "-1"
Test #100:
score: 3
Accepted
time: 753ms
memory: 81088kb
input:
500000 -377422510 717889852 -312344846 -706566892 933982752 -698704595 550384420 989933090 312560403 980903480 490407298 949005811 20868665 -999606757 313926261 621673439 93593796 -224393492 941082359 495629971 -348654037 -769575776 -735222029 -473609200 372027331 -835636233 -149554425 645405491 -39...
output:
41647432865
result:
ok 1 number(s): "41647432865"
Test #101:
score: 3
Accepted
time: 670ms
memory: 62320kb
input:
500000 177456 -416542 -422643 -85152 457849 -496196 33595 -17000 -387947 -45935 322011 -130510 463302 177090 -357267 -179087 -250313 -171133 294899 -156081 262136 190263 397640 -382556 -1293 -475360 -406846 142643 -137589 346072 -144621 93833 -494114 295157 -224715 -305962 3825 318107 -99311 144085 ...
output:
38624720138
result:
ok 1 number(s): "38624720138"
Test #102:
score: 3
Accepted
time: 259ms
memory: 31076kb
input:
500000 -3269 -3514 -1241 4809 1444 2209 -4478 -3589 3509 -4587 -1310 -4124 -3475 -2687 3749 904 2661 4531 -1420 -4182 860 -3430 -3638 -610 -1055 -114 1920 2946 -228 -1951 -2907 2470 -4146 -696 1265 1048 1867 3277 -1399 -1470 3788 4949 4054 -4011 -2784 -4678 3978 -716 1957 -2282 1071 4517 -1538 3879 ...
output:
31510054346
result:
ok 1 number(s): "31510054346"
Test #103:
score: 3
Accepted
time: 260ms
memory: 30068kb
input:
500000 135 310 425 37 -42 491 -176 -102 333 408 -124 344 417 -318 247 319 372 -400 475 497 230 277 480 -214 227 -383 -416 -340 -98 -464 -192 -250 -127 -154 -303 -84 -116 -316 -168 -264 -316 -277 401 342 81 330 -42 257 -182 -226 285 424 249 -286 468 -340 455 -81 -323 59 -88 -118 -182 395 -399 143 -39...
output:
31206000431
result:
ok 1 number(s): "31206000431"
Test #104:
score: 3
Accepted
time: 193ms
memory: 28836kb
input:
500000 13 -49 15 -28 15 10 4 32 2 -26 31 -16 -2 11 39 -9 -7 5 14 -7 -44 -39 34 16 0 -12 -19 28 12 9 8 39 37 -10 30 10 40 -39 -20 -39 10 34 12 -12 -33 46 -10 22 -12 -32 -17 -14 -13 9 -16 18 32 -49 -38 34 5 23 -6 -44 -25 18 28 -5 -25 12 34 39 -2 10 37 36 -3 -35 47 -7 -1 -25 3 29 -44 0 -37 6 15 31 31 3...
output:
30603007640
result:
ok 1 number(s): "30603007640"
Extra Test:
score: 0
Extra Test Passed