QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#226493 | #5425. Proposition Composition | Ishy | WA | 1771ms | 25752kb | C++14 | 8.7kb | 2023-10-26 00:23:28 | 2023-10-26 00:23:28 |
Judging History
answer
#include<bits/stdc++.h>
#define LL long long
#define DB double
#define MOD 1000000007
#define ls(x) (x << 1)
#define rs(x) (x << 1 | 1)
#define lowbit(x) ((-x) & x)
#define MP make_pair
#define MT make_tuple
#define VI vector<int>
#define VL vector<LL>
#define VII VI::iterator
#define VLI VL::iterator
#define all(x) x.begin(), x.end()
#define EB emplace_back
#define PII pair<int, int>
#define SI set<int>
#define SII SI::iterator
#define fi first
#define se second
using namespace std;
template<typename T> void chkmn(T &a, const T b) { (a > b) && (a = b); }
template<typename T> void chkmx(T &a, const T b) { (a < b) && (a = b); }
void Inc(int &a, const int &b) { ((a += b) >= MOD) && (a -= MOD); }
void Dec(int &a, const int &b) { ((a -= b) < 0) && (a += MOD); }
void Mul(int &a, const int &b) { a = 1LL * a * b % MOD; }
void Sqr(int &a) { a = 1LL * a * a % MOD; }
int inc(const int &a, const int &b) { return (a + b >= MOD) ? a + b - MOD : a + b; }
int dec(const int &a, const int &b) { return (a - b < 0) ? a - b + MOD : a - b; }
int mul(const int &a, const int &b) { return 1LL * a * b % MOD; }
int sqr(const int &a) { return 1LL * a * a % MOD; }
int qwqmi(int x, int k = MOD - 2)
{
int res = 1;
while(k)
{
if(k & 1) Mul(res, x);
k >>= 1, Sqr(x);
}
return res;
}
void read(int &x)
{
x = 0;
int f = 1;
char ch = getchar();
while(!isdigit(ch))
{
if(ch == '-')
f = -1;
ch = getchar();
}
while(isdigit(ch))
{
x = (x << 1) + (x << 3) + (ch ^ 48);
ch = getchar();
}
x = x * f;
}
const int N = 2.5e5 + 5;
int T, n, m, ecnt;
LL func(int x)
{
return 1LL * x * (x - 1) / 2;
}
namespace Brute3 // n <= 2000
{
const int base = 721513721;
int hsh[2005], cnt[2005];
map<int, int> mp;
void clear()
{
mp.clear();
memset(hsh, 0, sizeof(hsh));
memset(cnt, 0, sizeof(cnt));
}
void update(int l, int r)
{
for(int i = l; i <= r; ++i)
{
++cnt[i];
hsh[i] = inc(mul(hsh[i], base), ecnt);
}
}
int calc()
{
int res = 0;
int zcnt = 0, ocnt = 0;
mp.clear();
for(int i = 1; i < n; ++i)
{
zcnt += (cnt[i] == 0);
ocnt += (cnt[i] == 1);
if(cnt[i] > 0) mp[hsh[i]]++;
}
res += zcnt * (ecnt - 1) - func(zcnt);
res += ocnt;
for(auto now : mp)
{
int c = now.se;
res += func(c);
}
return res;
}
void work()
{
clear();
for(int cas = 1; cas <= m; ++cas)
{
++ecnt;
int l, r;
read(l), read(r);
if(l > r) swap(l, r);
if(l < r) update(l, r - 1);
printf("%d\n", calc());
}
}
};
namespace Cleveland // special
{
LL W = 0, zcnt, ocnt;
LL calc()
{
LL res = W;
res += zcnt * (ecnt - 1) - zcnt * (zcnt - 1) / 2;
res += ocnt;
return res;
}
void clear()
{
W = 0;
zcnt = n - 1;
ocnt = 0;
}
void work()
{
clear();
for(int cas = 1; cas <= m; ++cas)
{
++ecnt;
int l, r;
read(l), read(r);
int len = r - l;
zcnt -= len;
ocnt += len;
W += 1LL * len * (len - 1);
printf("%lld\n", calc());
}
}
};
namespace Enterprise // std
{
int bel[N], pre[N], nxt[N];
int lcnt, hd[N], sz[N];
void Print_Chain()
{
printf("lcnt : %d\n", lcnt);
for(int i = 1; i <= lcnt; ++i)
{
printf("%d : ", sz[i]);
int x = hd[i];
while(1)
{
printf("%d ", x);
if(x == nxt[x]) break;
x = nxt[x];
}
puts("");
}
}
vector<PII> vec;
LL W = 0;
struct SGT
{
struct SegTree
{
int l, r;
int cnt[2];
int mnv, mxv;
int add;
}tr[N << 2];
void pushup(int p)
{
tr[p].cnt[0] = tr[ls(p)].cnt[0] + tr[rs(p)].cnt[0];
tr[p].cnt[1] = tr[ls(p)].cnt[1] + tr[rs(p)].cnt[1];
tr[p].mnv = min(tr[ls(p)].mnv, tr[rs(p)].mnv);
tr[p].mxv = max(tr[ls(p)].mxv, tr[rs(p)].mxv);
}
void build(int p, int l, int r)
{
if(l > r) return;
tr[p].l = l;
tr[p].r = r;
tr[p].add = 0;
if(l == r)
{
tr[p].cnt[0] = 1;
tr[p].cnt[1] = 0;
tr[p].mnv = pre[l];
tr[p].mxv = nxt[l];
return;
}
int mid = l + (r - l) / 2;
build(ls(p), l, mid);
build(rs(p), mid + 1, r);
pushup(p);
}
void cal(SegTree &u, int v)
{
u.add += v;
u.cnt[1] = 0;
if(v == 1)
u.cnt[1] = u.cnt[0];
u.cnt[0] = 0;
}
void pushdown(int p)
{
if(tr[p].add)
{
cal(tr[ls(p)], tr[p].add);
cal(tr[rs(p)], tr[p].add);
tr[p].add = 0;
}
}
void modify_add(int p, int l, int r, int v)
{
if(tr[p].l >= l && tr[p].r <= r)
{
cal(tr[p], v);
return;
}
pushdown(p);
int mid = tr[p].l + (tr[p].r - tr[p].l) / 2;
if(mid >= l) modify_add(ls(p), l, r, v);
if(mid < r) modify_add(rs(p), l, r, v);
pushup(p);
}
void find_L(int p, int l, int r)
{
if(tr[p].l > r || tr[p].r < l || tr[p].mnv >= l) return;
if(tr[p].l == tr[p].r) return vec.EB(MP(bel[tr[p].l], tr[p].l)), void();
if(tr[ls(p)].mnv < l) find_L(ls(p), l, r);
if(tr[rs(p)].mnv < l) find_L(rs(p), l, r);
}
void find_R(int p, int l, int r)
{
if(tr[p].l > r || tr[p].r < l || tr[p].mxv <= r) return;
if(tr[p].l == tr[p].r) return vec.EB(MP(bel[tr[p].l], nxt[tr[p].l])), void();
if(tr[ls(p)].mxv > r) find_R(ls(p), l, r);
if(tr[rs(p)].mxv > r) find_R(rs(p), l, r);
}
void modify_mnx(int p, int x, int v, int op)
{
if(tr[p].l == tr[p].r)
{
if(op == 0) tr[p].mnv = v;
else tr[p].mxv = v;
return;
}
pushdown(p);
int mid = tr[p].l + (tr[p].r - tr[p].l) / 2;
if(mid >= x) modify_mnx(ls(p), x, v, op);
else modify_mnx(rs(p), x, v, op);
pushup(p);
}
}T;
void disconnect(int x) // pre[x] <-/-> x
{
int y = pre[x];
pre[x] = x; T.modify_mnx(1, x, x, 0);
nxt[y] = y; T.modify_mnx(1, y, y, 1);
}
void connect(int x, int y) // x <---> y
{
pre[y] = x; T.modify_mnx(1, y, x, 0);
nxt[x] = y; T.modify_mnx(1, x, y, 1);
}
void Make_New_Chain(vector<int> V)
{
++lcnt;
hd[lcnt] = V[0];
sz[lcnt] = (int)V.size();
for(int i = 0; i < (int)V.size(); ++i)
{
int x = V[i];
bel[x] = lcnt;
// if(i > 0) connect(V[i - 1], x);
}
}
void cut(int id, int l, int r) // [L, p) [l, r] (q, R]
{
// puts("3-cut");
W -= func(sz[id]);
int p = pre[l], q = nxt[r];
disconnect(l);
disconnect(q);
connect(p, q);
// printf("### %d %d %d\n", l, r, nxt[3]);
vector<int> V1, V2;
V1.clear(), V2.clear();
int u = hd[id], v = l;
while(1)
{
V1.EB(u), V2.EB(v);
if(nxt[u] == u && u != p)
{
hd[id] = l;
sz[id] -= (int)V1.size();
Make_New_Chain(V1);
break;
}
else if(nxt[v] == v)
{
sz[id] -= (int)V2.size();
Make_New_Chain(V2);
break;
}
u = (u == p) ? q : nxt[u];
v = nxt[v];
}
W += func(sz[id]) + func(sz[lcnt]);
}
void cut(int id, int r) // [L, p) [r, R]
{
// puts("2-cut");
W -= func(sz[id]);
disconnect(r);
vector<int> V1, V2;
V1.clear(), V2.clear();
int u = hd[id], v = r;
while(1)
{
V1.EB(u), V2.EB(v);
if(nxt[u] == u)
{
hd[id] = r;
sz[id] -= (int)V1.size();
Make_New_Chain(V1);
break;
}
else if(nxt[v] == v)
{
sz[id] -= (int)V2.size();
Make_New_Chain(V2);
break;
}
u = nxt[u];
v = nxt[v];
}
W += func(sz[id]) + func(sz[lcnt]);
}
LL calc()
{
LL res = 0;
int zcnt = T.tr[1].cnt[0];
int ocnt = T.tr[1].cnt[1];
res += 1LL * zcnt * (ecnt - 1) - func(zcnt); // case1
res += ocnt; // case2
res += W - func(zcnt); // case3
// assert(zcnt < n);
// printf("zcnt : %d\n", zcnt);
return res;
}
void clear()
{
W = func(n - 1);
lcnt = 1;
hd[lcnt] = 1;
sz[lcnt] = n - 1;
for(int i = 1; i <= n - 1; ++i)
{
bel[i] = 1;
pre[i] = max(1, i - 1);
nxt[i] = min(n - 1, i + 1);
}
T.build(1, 1, n - 1);
}
void work()
{
clear();
for(int cas = 1; cas <= m; ++cas)
{
++ecnt;
vec.clear();
int l, r; read(l), read(r);
if(l > r) swap(l, r);
if(l == r)
{
if(n == 1) puts("0");
else printf("%lld\n", calc());
continue;
}
--r;
T.modify_add(1, l, r, 1);
T.find_L(1, l, r);
T.find_R(1, l, r);
sort(vec.begin(), vec.end());
for(int i = 0; i < (int)vec.size();)
{
if(i + 1 < (int)vec.size() && vec[i].fi == vec[i + 1].fi)
cut(vec[i].fi, vec[i].se, pre[vec[i + 1].se]), i += 2;
else cut(vec[i].fi, vec[i].se), ++i;
}
printf("%lld\n", calc());
// Print_Chain();
}
}
};
void work()
{
read(n), read(m);
ecnt = n - 1;
if(n <= 2000 && m <= 2000)
Brute3::work();
// else assert(0);
else Enterprise::work();
}
int main()
{
scanf("%d", &T);
while(T--)
work();
return 0;
}
/*
3
4 3
2 4
4 2
3 3
7 3
3 4
1 2
1 7
6 4
1 3
4 6
2 5
3 4
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 5800kb
input:
3 4 3 2 4 4 2 3 3 7 3 3 4 1 2 1 7 6 4 1 3 4 6 2 5 3 4
output:
6 5 6 21 24 10 15 12 3 2
result:
ok 10 numbers
Test #2:
score: 0
Accepted
time: 36ms
memory: 5764kb
input:
45540 10 9 10 1 1 10 10 1 1 10 1 10 10 1 1 10 3 3 10 1 10 4 1 2 1 10 3 4 1 10 7 6 7 1 5 6 1 7 6 6 7 1 6 7 9 7 3 3 7 7 5 4 1 1 9 1 9 1 6 5 8 7 1 8 4 4 5 6 1 1 1 8 6 6 4 5 3 3 3 2 3 1 3 3 3 9 3 1 3 3 2 2 3 3 3 1 2 2 1 1 2 3 3 1 10 1 2 1 7 1 1 7 3 8 1 3 1 3 3 3 1 3 2 2 1 3 1 3 3 3 3 6 3 1 1 3 1 3 1 3 1...
output:
45 36 36 36 36 36 36 36 36 45 36 28 21 21 15 10 10 10 6 36 44 50 57 28 21 15 28 28 21 21 15 15 10 3 1 1 3 3 3 3 1 1 1 0 0 45 21 3 1 1 1 1 1 1 1 3 1 1 1 1 1 45 36 36 36 36 36 36 36 3 3 1 0 0 0 0 0 0 3 1 0 0 15 10 10 0 0 0 0 0 0 0 0 28 34 21 6 6 6 6 1 0 0 21 15 15 0 0 0 0 0 0 0 45 53 0 0 0 0 0 0 0 0 1...
result:
ok 249586 numbers
Test #3:
score: 0
Accepted
time: 353ms
memory: 5740kb
input:
2507 86 4 41 41 36 36 31 30 86 1 110 22 1 110 110 1 11 11 110 1 110 1 110 1 1 110 107 106 72 72 106 106 74 74 1 110 110 1 58 58 110 1 110 1 1 110 101 100 110 1 100 100 110 1 8 7 114 180 114 1 114 1 114 1 1 114 1 114 114 1 37 38 49 48 105 106 1 114 90 90 1 114 9 9 114 1 67 68 20 20 114 1 1 114 54 55 ...
output:
3655 3740 3823 3570 5995 5886 5886 5886 5886 5886 5886 5778 5778 5778 5778 5778 5778 5778 5778 5778 5778 5671 5671 5671 5671 5565 6441 6328 6328 6328 6328 6328 6216 6105 5995 5995 5995 5995 5995 5995 5886 5886 5886 5886 5778 5671 5671 5565 5565 5460 5460 5460 5460 5460 5356 5253 5253 5253 5151 5151 ...
result:
ok 249877 numbers
Test #4:
score: 0
Accepted
time: 61ms
memory: 16316kb
input:
3 82425 27858 30801 30802 1 82425 73850 73850 1 82425 65949 65949 82425 1 76026 76025 61936 61936 82425 1 82425 1 82425 1 6504 6504 82425 1 25155 25156 79743 79743 1 82425 69406 69406 29247 29247 18351 18351 23171 23170 29704 29703 82425 1 1 82425 82425 1 74918 74917 22395 22394 893 894 82425 1 391 ...
output:
3396899100 3396816676 3396816676 3396734253 3396734253 3396734253 3396651831 3396651831 3396651831 3396651831 3396651831 3396651831 3396651831 3396569410 3396569410 3396569410 3396569410 3396569410 3396569410 3396486990 3396404571 3396404571 3396404571 3396404571 3396322153 3396239736 3396157320 339...
result:
ok 116748 numbers
Test #5:
score: 0
Accepted
time: 136ms
memory: 23676kb
input:
1 250000 250000 248617 248617 1 250000 47808 47809 1 250000 1 250000 110493 110494 1 250000 66675 66676 141326 141327 250000 1 115279 115280 193218 193219 250000 1 77714 77715 1 250000 1 250000 212943 212943 223061 223060 1 250000 250000 1 1 250000 71059 71059 1 250000 246523 246522 1 250000 88700 8...
output:
31249875000 31249875000 31249625001 31249375003 31249375003 31249125006 31249125006 31248875010 31248625015 31248625015 31248375021 31248125028 31248125028 31247875036 31247875036 31247875036 31247875036 31247625045 31247625045 31247625045 31247625045 31247625045 31247625045 31247375055 31247375055 ...
result:
ok 250000 numbers
Test #6:
score: 0
Accepted
time: 41ms
memory: 5736kb
input:
45364 9 7 1 8 9 8 8 9 8 2 9 8 2 8 4 2 10 2 2 10 1 10 10 7 8 9 4 4 10 10 1 10 2 9 9 1 6 8 6 7 6 2 5 1 1 5 5 5 1 5 2 3 5 1 10 1 2 10 9 6 1 8 2 9 2 1 9 8 2 8 8 1 1 4 1 1 1 1 1 1 1 1 8 1 2 2 3 7 3 2 2 2 3 1 2 3 2 3 3 3 3 3 5 1 4 2 3 9 3 1 1 2 1 2 2 1 2 1 1 1 3 2 2 2 3 2 3 2 3 1 3 2 3 6 3 1 2 2 2 2 1 3 3...
output:
36 29 28 16 16 16 8 45 29 45 53 61 36 18 16 8 15 5 4 4 4 2 2 45 36 17 16 15 15 15 0 0 0 0 28 3 4 1 1 1 1 1 10 3 1 1 1 1 1 0 0 0 3 1 3 3 3 1 0 0 6 36 30 12 8 8 3 4 5 5 1 0 0 0 0 0 6 5 6 1 0 0 0 0 0 0 28 32 19 20 11 7 7 21 17 17 12 4 3 2 1 1 21 11 7 6 3 3 1 2 1 1 28 25 20 21 22 22 23 11 1 1 28 1 1 0 0...
result:
ok 249141 numbers
Test #7:
score: 0
Accepted
time: 503ms
memory: 5768kb
input:
2517 14 35 2 13 14 1 14 14 1 14 7 7 1 14 7 7 2 14 9 11 2 4 2 13 11 12 14 2 13 1 14 1 13 2 12 11 2 14 1 13 12 11 1 14 4 5 2 14 14 14 13 13 10 9 14 2 1 14 14 2 13 2 14 2 7 8 6 6 1 1 13 1 51 125 30 30 40 39 25 24 51 1 1 51 40 40 8 7 50 2 2 50 7 9 50 1 30 30 47 49 14 16 2 4 1 51 1 50 6 6 1 51 4 4 50 2 2...
output:
91 58 58 56 56 56 56 55 37 23 23 17 17 17 17 17 17 17 17 17 17 12 12 12 12 11 11 11 11 11 11 7 7 7 7 1275 1324 1370 1176 1128 1128 1081 991 991 947 946 946 862 782 706 706 706 706 706 706 706 706 706 668 598 598 598 598 532 532 532 532 532 532 532 500 469 469 469 469 411 383 383 383 331 331 331 331 ...
result:
ok 250000 numbers
Test #8:
score: 0
Accepted
time: 37ms
memory: 16636kb
input:
5 65849 4012 8907 8905 21927 21927 2 65849 2 65848 65849 1 1 65849 48863 48861 2 65849 7795 7795 65849 2 2 65849 65849 2 2696 2695 65848 2 41766 41765 2 65849 36403 36403 65849 2 32613 32613 26782 26781 60024 60024 44568 44570 5043 5043 52955 52954 15301 15299 65849 2 1 65849 27002 27000 22706 22707...
output:
2168012476 2168078322 2167880786 2167749099 2167683248 2167683247 2167551563 2167551563 2167551563 2167551563 2167551563 2167551563 2167485722 2167485722 2167419882 2167419882 2167419882 2167419882 2167419882 2167354043 2167354043 2167222369 2167222369 2167156533 2167024865 2167024865 2167024865 216...
result:
ok 52236 numbers
Test #9:
score: 0
Accepted
time: 202ms
memory: 25724kb
input:
1 250000 250000 97733 97731 132027 132027 196875 196877 1 250000 170476 170476 44407 44407 250000 1 249999 2 133959 133958 45337 45335 246071 246069 2589 2587 1 249999 172569 172570 2 249999 250000 2 244802 244804 79199 79199 1 249999 249999 1 213003 213003 84015 84014 92491 92492 124485 124485 1803...
output:
31249875000 31250124997 31250374986 31248875012 31248875012 31248875012 31248625017 31248125031 31247875039 31247375059 31246875083 31246375111 31246375110 31246125125 31246125125 31246125125 31245625159 31245625159 31245625159 31245625159 31245625159 31245375177 31245125196 31245125196 31244875216 ...
result:
ok 250000 numbers
Test #10:
score: 0
Accepted
time: 49ms
memory: 5864kb
input:
45413 6 5 3 1 6 5 5 1 2 5 2 2 9 3 5 5 4 5 5 4 6 10 1 6 5 2 6 3 5 2 2 2 2 6 3 5 5 5 2 2 1 6 7 3 4 4 1 1 4 1 6 10 1 1 4 6 2 2 3 5 3 5 5 3 4 6 4 4 3 5 5 5 1 10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 4 4 10 6 3 3 8 3 6 10 1 4 4 9 5 2 9 2 1 7 7 2 9 1 9 5 1 5 5 3 2 1 3 2 1 9 8 6 3 9 6 4 4 6 9 7 7 7 4 ...
output:
15 15 5 2 2 36 43 49 15 6 2 2 2 2 2 2 2 1 21 27 27 15 18 21 17 18 20 21 23 25 27 0 0 0 0 0 0 0 0 0 0 45 31 26 28 45 36 29 29 22 21 10 3 1 36 29 31 30 32 28 29 4 1 2 3 4 5 6 1 1 0 0 45 52 43 37 34 34 36 35 37 21 16 12 11 12 13 12 13 10 10 8 8 9 10 11 1 1 36 28 8 45 32 26 27 18 16 17 17 2 1 10 8 2 1 0...
result:
ok 250000 numbers
Test #11:
score: 0
Accepted
time: 940ms
memory: 5736kb
input:
2446 12 162 6 8 8 9 11 8 3 10 9 8 2 5 10 1 1 4 7 8 10 12 1 5 10 4 2 11 7 4 3 9 10 5 8 3 11 1 4 10 11 6 7 10 12 8 11 9 4 3 6 1 8 4 2 2 10 12 7 9 12 12 7 9 8 11 4 4 11 11 6 10 8 5 8 5 11 8 8 2 5 7 9 9 2 2 10 4 6 9 12 8 7 1 1 6 12 10 1 8 5 11 4 3 6 8 4 5 3 7 4 8 12 7 1 11 2 9 6 8 12 7 8 5 9 3 11 3 9 3 ...
output:
66 72 69 47 50 36 21 20 20 1 1 1 1 1 1 1 1 1 1 1 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 244825 numbers
Test #12:
score: 0
Accepted
time: 217ms
memory: 16856kb
input:
4 39845 77223 11304 11308 2 39838 6 39838 9 39836 39840 2 3 39844 5582 5576 11054 11055 39841 6 15426 15418 39837 3 18844 18851 5 39839 15992 16000 9 39844 39358 39355 9 39843 6 39843 7 39844 34287 34281 284 276 6614 6606 27606 27605 2870 2868 6 39845 39842 7 36916 36913 33317 33321 39836 3 39841 3 ...
output:
793792090 793632766 793433634 793234527 793154851 792995480 792756580 792716766 792716764 792398302 792398300 792119695 792119694 791801352 791801348 791681980 791681980 791681982 791681982 791443280 791125074 790806932 790767167 790687639 790647775 790647775 790528490 790369459 790369460 790369461 ...
result:
ok 250000 numbers
Test #13:
score: 0
Accepted
time: 299ms
memory: 25648kb
input:
1 250000 250000 237315 237325 161044 161036 137460 137451 247727 247730 38655 38653 23041 23049 5 249992 249997 2 178760 178760 198841 198847 10 249995 146224 146229 5 249999 8273 8274 249995 5 210583 210583 5 249996 249997 2 249998 9 81327 81318 3 249991 25090 25085 249991 10 48955 48955 249996 1 1...
output:
31249875000 31250124901 31250374702 31250624584 31250874485 31251124156 31239876513 31237626626 31237626630 31236126988 31234877294 31233627643 31233127625 31232877697 31232877699 31232877701 31232877702 31232877701 31232877697 31230628410 31230378490 31229128917 31229128919 31229128921 31228878902 ...
result:
ok 250000 numbers
Test #14:
score: 0
Accepted
time: 1239ms
memory: 5732kb
input:
2502 18 58 12 14 10 14 16 6 17 5 11 12 7 7 3 3 13 3 9 10 10 6 10 7 4 4 2 14 7 12 9 9 10 6 2 6 16 3 12 9 14 8 18 14 9 11 7 8 13 10 15 8 4 5 3 6 6 2 6 17 18 9 17 18 12 7 15 6 18 16 11 12 14 8 13 15 9 5 5 15 2 11 18 2 1 3 16 6 5 1 13 11 12 13 17 13 4 3 16 14 11 15 6 18 18 15 13 7 10 7 4 4 16 11 9 6 16 ...
output:
153 160 135 110 114 119 124 80 80 83 84 87 62 64 66 68 69 71 73 74 40 41 42 43 43 43 44 45 46 46 47 48 49 50 51 52 53 54 55 56 57 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4753 3942 3981 3590 3619 3639 3612 3584 3507 2005 2005 1721 1604 1225 1228 1227 1130 1120 1120 1120 1114 899 878 750 740 745 746 751 724...
result:
ok 250000 numbers
Test #15:
score: 0
Accepted
time: 1133ms
memory: 8408kb
input:
102 4953 1459 24 4912 4916 160 4771 89 139 4945 4897 187 2648 2783 119 4844 2725 2891 3572 3737 695 880 316 258 45 4925 159 4883 199 4923 4847 52 1026 1185 193 4882 4449 4249 3997 4032 4860 10 163 4910 3344 3396 1738 1730 2418 2339 4304 4163 1874 1837 4884 106 4880 72 4809 86 2724 2895 67 4832 4820 ...
output:
12263628 11593112 10938335 10795386 10669759 10069175 10064737 9591474 8902465 8164161 7936078 7934952 7934417 7887382 7887046 7288919 7288879 6576510 6453096 6383660 6383579 6202896 6175177 5907542 5615612 5494824 5494607 5494244 5492889 5479786 5479452 5479335 5473146 5163189 4688416 4646510 46390...
result:
ok 250000 numbers
Test #16:
score: 0
Accepted
time: 222ms
memory: 17000kb
input:
4 21918 92931 82 21855 7116 7178 9491 9490 21730 78 43 21862 5666 5629 21015 20888 21890 82 5601 5698 104 21745 12125 12198 21860 87 20657 20742 147 21825 12995 13023 50 21817 21917 162 21740 43 9798 9869 5509 5678 21888 160 21916 38 21752 106 108 21891 11552 11750 52 21803 21741 67 17717 17606 193 ...
output:
240188403 238842403 238820836 236014166 235099375 234302197 231581828 230970546 229688956 229217918 227665570 227665545 225865230 224953966 224362956 224362226 223455542 223455528 221962867 220036366 220036331 219926847 219926348 219926283 215820989 215820261 215820130 213531015 212892565 212892184 ...
result:
ok 250000 numbers
Test #17:
score: 0
Accepted
time: 300ms
memory: 25752kb
input:
1 250000 250000 111 249894 249917 58 218975 218775 249877 56 27879 27766 173773 173666 156284 156320 91013 90934 94 249845 87959 87909 249981 112 249935 1 249903 46 173989 173869 188 249834 13 249973 37722 37870 111 250000 47757 47909 249990 16 195 249827 249825 178 78173 78038 205733 205898 54532 5...
output:
31249875000 31230641849 31180725389 31175981911 31147793860 31121113976 31112138954 31092449843 31084475001 31072017689 31055776912 31042029658 31042029091 31012145750 30990487902 30990487150 30953665805 30948915873 30911122441 30911122252 30907641474 30907143405 30873597255 30832623630 30788949406 ...
result:
ok 250000 numbers
Test #18:
score: -100
Wrong Answer
time: 1771ms
memory: 10540kb
input:
109 1078 1889 1007 282 178 79 751 816 125 68 1066 175 742 543 497 489 930 354 847 438 315 601 821 685 951 524 489 665 836 3 984 270 1062 332 344 978 550 22 580 703 895 626 1021 237 827 678 954 925 316 455 1059 524 679 727 945 945 254 123 1061 193 420 105 1054 522 484 402 251 359 770 922 704 785 284 ...
output:
580503 508981 466269 454941 317613 225953 222408 177191 154391 131150 126077 122805 120227 46277 44428 43793 43525 42262 40944 38303 35796 35665 35457 34877 34777 34425 34439 34093 33445 31803 31602 30607 30364 29378 28904 28824 27974 27919 27397 27111 27082 26766 26608 26498 26332 26334 26238 26190...
result:
wrong answer 11673rd numbers differ - expected: '469', found: '470'