QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#340473 | #6313. 人员调度 | KevinLikesCoding | 100 ✓ | 1291ms | 50956kb | C++14 | 7.4kb | 2024-02-29 08:28:40 | 2024-02-29 08:28:41 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define int128 __int128
#define FOR(i, m, n) for(int i=(m);i<=(n);i++)
#define ROF(i, m, n) for(int i=(m);i>=(n);i--)
#define REP(i, n) for(int i=0;i<(n);i++)
#define BG(v) v.begin()
#define ED(v) v.end()
#define ALL(v) (v).begin(), (v).end()
#define SZ(v) v.size()
#define FI(v) v.first
#define SE(v) v.second
#define func(v) function<v>
#define pb push_back
#define eb emplace_back
#define DFS func(void(int, int))
#define PII pair<int,int>
#define PLL pair<ll, ll>
#define endl '\n'
const int INF = 1e9 + 7;
const ll LNF = 1e18 + 7;
const double EPS = 1e-8;
const int P = 998244353;
const int G = 3;
const int GI = 332748118;
template <typename T, typename U>
inline bool chmax(T& a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U>
inline bool chmin(T& a, U b) { return a > b ? (a = b, true) : false; }
void IOSinit() {
ios :: sync_with_stdio(0);
cin.tie(0); cout.tie(0);
}
int fp(int x,int y) {
int res = 1;
for(;y;y >>= 1) {
if(y & 1) res = (1ll * res * x) % P;
x = (1ll * x * x) % P;
}
return res;
}
const int N = 1e5 + 5;
int I, n, k, m;
struct Stf {
int u, v;
Stf() {
u = 0, v = INF;
}
bool operator < (const Stf &A) const {
return v < A.v;
}
bool operator > (const Stf &A) const {
return v > A.v;
}
} a[N << 1];
int fi[N], ne[N], to[N], ecnt;
int fa[N], sz[N], dfn[N], rnk[N], son[N], top[N], dnt;
int lst[N << 1];
ll ans[N];
void add(int u, int v) {
ne[++ecnt] = fi[u];
to[ecnt] = v;
fi[u] = ecnt;
}
void dfs1(int u) {
sz[u] = 1;
son[u] = -1;
for(int i = fi[u]; i; i = ne[i]) {
int v = to[i];
dfs1(v);
sz[u] += sz[v];
if(son[u] == -1 || sz[v] >= sz[son[u]]) son[u] = v;
}
}
void dfs2(int u, int tp) {
top[u] = tp;
dfn[u] = ++dnt;
rnk[dnt] = u;
if(son[u] != -1) dfs2(son[u], tp);
for(int i = fi[u]; i; i = ne[i]) {
int v = to[i];
if(v != son[u]) dfs2(v, v);
}
}
namespace SgT_I {
struct Node {
int x;
Node(int _x = 0) {
x = _x;
}
bool operator < (const Node &A) const {
if(a[x].v != a[A.x].v) return a[x] < a[A.x];
return x < A.x;
}
};
set<Node> S[N];
int F[N << 2];
void pushup(int u) {
if(a[F[u << 1]] < a[F[u << 1 | 1]]) F[u] = F[u << 1];
else F[u] = F[u << 1 | 1];
}
void modify(int u, int l, int r, int p, int x) {
if(l == r) {
F[u] = x;
return;
}
int mid = l + r >> 1;
if(p <= mid) modify(u << 1, l, mid, p, x);
else modify(u << 1 | 1, mid + 1, r, p, x);
pushup(u);
}
int query(int u, int l, int r, int ql, int qr) {
if(ql <= l && r <= qr) {
return F[u];
}
int mid = l + r >> 1;
if(qr <= mid) return query(u << 1, l, mid, ql, qr);
if(ql > mid) return query(u << 1 | 1, mid + 1, r, ql, qr);
int vl = query(u << 1, l, mid, ql, qr);
int vr = query(u << 1 | 1, mid + 1, r, ql, qr);
if(a[vl] < a[vr]) return vl;
return vr;
}
void insert(int i) {
int u = a[i].u;
S[u].insert(Node(i));
modify(1, 1, n, dfn[u], (*S[u].begin()).x);
}
void del(int i) {
int u = a[i].u;
S[u].erase(Node(i));
if(S[u].empty()) modify(1, 1, n, dfn[u], 0);
else modify(1, 1, n, dfn[u], (*S[u].begin()).x);
}
}
namespace SgT_M {
int F[N << 2], T[N << 2];
void pushup(int u) {
F[u] = min(F[u << 1], F[u << 1 | 1]);
}
void push(int u, int x) {
F[u] += x;
T[u] += x;
}
void pushdown(int u) {
if(T[u]) {
push(u << 1, T[u]);
push(u << 1 | 1, T[u]);
T[u] = 0;
}
}
void build(int u, int l, int r) {
if(l == r) {
F[u] = sz[rnk[l]];
return;
}
int mid = l + r >> 1;
build(u << 1, l, mid);
build(u << 1 | 1, mid + 1, r);
pushup(u);
}
void modify(int u, int l, int r, int ql, int qr, int x) {
if(ql <= l && r <= qr) {
push(u, x);
return;
}
pushdown(u);
int mid = l + r >> 1;
if(ql <= mid) modify(u << 1, l, mid, ql, qr, x);
if(mid < qr) modify(u << 1 | 1, mid + 1, r, ql, qr, x);
pushup(u);
}
int query_m(int u, int l, int r, int ql, int qr) {
if(ql <= l && r <= qr) {
return F[u];
}
pushdown(u);
int mid = l + r >> 1;
if(qr <= mid) return query_m(u << 1, l, mid, ql, qr);
if(ql > mid) return query_m(u << 1 | 1, mid + 1, r, ql, qr);
return min(query_m(u << 1, l, mid, ql, qr), query_m(u << 1 | 1, mid + 1, r, ql, qr));
}
int query_p(int u, int l, int r, int ql, int qr) {
if(ql <= l && r <= qr) {
if(F[u] > 0) return 0;
while(l < r) {
int mid = l + r >> 1;
pushdown(u);
if(!F[u << 1 | 1]) {
u = u << 1 | 1;
l = mid + 1;
}
else {
u = u << 1;
r = mid;
}
}
return rnk[l];
}
pushdown(u);
int mid = l + r >> 1;
if(qr <= mid) return query_p(u << 1, l, mid, ql, qr);
if(ql > mid) return query_p(u << 1 | 1, mid + 1, r, ql, qr);
int val = query_p(u << 1 | 1, mid + 1, r, ql, qr);
if(val) return val;
return query_p(u << 1, l, mid, ql, qr);
}
}
namespace SgT_T {
void build() {
SgT_M :: build(1, 1, n);
}
void modify(int u, int x) {
while(u) {
int v = top[u];
SgT_M :: modify(1, 1, n, dfn[v], dfn[u], x);
u = fa[v];
}
}
int query(int u) {
while(u) {
int v = top[u];
if(SgT_M :: query_m(1, 1, n, dfn[v], dfn[u]) > 0) {
u = fa[v];
continue;
}
return SgT_M :: query_p(1, 1, n, dfn[v], dfn[u]);
}
return 0;
}
}
namespace Main {
struct Node {
int u, v;
} stk[N << 1]; int tp;
ll ans;
void insert(int u) {
ans += a[u].v;
SgT_I :: insert(u);
SgT_T :: modify(a[u].u, -1);
}
void del(int u) {
ans -= a[u].v;
SgT_I :: del(u);
SgT_T :: modify(a[u].u, 1);
}
bool check(int u) {
int p = SgT_T :: query(a[u].u);
if(!p) {
tp++;
stk[tp].u = u;
stk[tp].v = 0;
insert(u);
return 1;
}
int lst = SgT_I :: query(1, 1, n, dfn[p], dfn[p] + sz[p] - 1);
if(a[lst] < a[u]) {
tp++;
stk[tp].u = u;
stk[tp].v = lst;
insert(u);
del(lst);
return 1;
}
return 0;
}
void roll() {
int u = stk[tp].u;
int v = stk[tp].v;
tp--;
del(u);
if(v) insert(v);
}
}
namespace SgT_B {
vector<int> e[N << 2];
void modify(int u, int l, int r, int ql, int qr, int x) {
if(ql <= l && r <= qr) {
e[u].pb(x);
return;
}
int mid = l + r >> 1;
if(ql <= mid) modify(u << 1, l, mid, ql, qr, x);
if(mid < qr) modify(u << 1 | 1, mid + 1, r, ql, qr, x);
}
void dfs(int u, int l, int r) {
int tp = 0;
for(int i : e[u]) tp += Main :: check(i);
int mid = l + r >> 1;
if(l == r) ans[l] = Main :: ans;
else dfs(u << 1, l, mid), dfs(u << 1 | 1, mid + 1, r);
while(tp--) Main :: roll();
}
}
void solve() {
cin >> I >> n >> k >> m;
FOR(i, 2, n) {
cin >> fa[i];
add(fa[i], i);
}
dfs1(1);
dfs2(1, 1);
SgT_T :: build();
FOR(i, 1, k) cin >> a[i].u >> a[i].v;
FOR(i, 1, m) {
int opt;
cin >> opt;
if(opt == 1) {
int u, v;
cin >> u >> v;
a[++k].u = u;
lst[k] = i;
a[k].v = v;
}
else {
int u;
cin >> u;
SgT_B :: modify(1, 0, m, lst[u], i - 1, u);
lst[u] = -1;
}
}
FOR(i, 1, k) if(lst[i] > -1) {
SgT_B :: modify(1, 0, m, lst[i], m, i);
}
SgT_B :: dfs(1, 0, m);
FOR(i, 0, m) {
cout << ans[i] << " ";
}
cout << endl;
}
int main() {
// freopen("transfer/transfer3.in", "r", stdin);
// freopen("transfer.out","w",stdout);
IOSinit();
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 2
Accepted
time: 0ms
memory: 30576kb
input:
1 6 6 6 1 2 3 2 3 1 52078 2 3759 1 85897 6 14295 3 47290 3 93702 1 2 41269 1 5 79793 1 6 88324 1 1 88307 1 4 64229 1 3 18664
output:
297021 334531 400029 447084 488101 500252 500252
result:
ok 7 numbers
Test #2:
score: 2
Accepted
time: 7ms
memory: 30640kb
input:
2 9 6 6 1 1 2 1 5 4 5 2 2 28610 4 62909 9 44990 8 38352 8 97403 4 91172 1 7 77724 1 5 73030 1 1 74599 1 2 11376 1 9 41281 1 5 52692
output:
325084 339899 412929 487528 487528 487528 540220
result:
ok 7 numbers
Test #3:
score: 2
Accepted
time: 0ms
memory: 30584kb
input:
2 9 6 6 1 2 3 4 4 1 3 2 2 43265 6 10749 4 75789 5 17017 3 68560 5 61211 1 1 82982 2 5 2 1 2 7 1 7 30320 2 6
output:
259574 342556 273996 230731 147749 178069 133875
result:
ok 7 numbers
Test #4:
score: 2
Accepted
time: 0ms
memory: 28600kb
input:
3 16 66 66 1 1 2 3 4 6 6 6 5 5 5 1 1 9 10 6 17077 6 78264 13 58368 15 52835 7 36607 9 43555 5 89936 15 55777 13 44137 1 66172 8 89009 2 1318 2 63845 8 93573 13 11924 15 74580 14 20835 6 9184 14 75018 16 94155 10 48597 5 41484 4 87492 14 9932 16 21740 13 4298 7 76915 3 81689 7 3064 7 9149 1 21961 6 1...
output:
1266121 1266121 1266121 1266121 1266121 1284726 1284726 1284726 1284726 1284726 1284726 1284726 1284726 1284726 1284726 1284726 1284726 1284726 1261079 1261079 1261079 1261079 1261079 1261079 1242276 1224701 1239267 1239267 1224701 1208538 1208538 1208538 1214706 1188250 1176898 1176898 1195695 1195...
result:
ok 67 numbers
Test #5:
score: 2
Accepted
time: 6ms
memory: 28664kb
input:
3 16 66 66 1 2 3 4 5 6 7 8 8 8 8 4 4 7 8 4 17274 9 14926 1 1389 15 21673 6 63249 7 25469 7 58444 5 16209 10 14761 2 74416 10 89493 11 85483 6 60737 16 97844 15 68483 5 86467 13 46164 4 12404 11 77651 10 32071 6 61761 6 82399 2 3843 13 76772 5 60099 8 56289 10 96527 4 43558 15 48089 1 63015 7 35381 4...
output:
1405383 1410463 1410463 1410463 1410463 1410463 1406819 1393470 1393470 1393470 1393470 1393470 1393470 1393470 1377057 1377057 1377057 1399071 1399071 1399071 1399071 1399071 1399071 1399071 1399071 1377120 1377120 1377120 1377120 1401176 1401176 1379303 1379303 1379303 1379303 1379303 1359256 1349...
result:
ok 67 numbers
Test #6:
score: 2
Accepted
time: 0ms
memory: 30704kb
input:
4 66 66 0 1 2 3 1 4 5 6 8 7 10 9 12 11 14 15 13 16 18 17 19 21 20 23 24 22 26 26 26 26 26 26 26 26 26 26 26 26 26 25 25 25 25 25 25 25 25 25 25 25 25 25 28 45 17 28 3 19 19 18 46 42 35 20 7 55 39 82261 51 30803 13 11540 7 22146 43 43489 49 85871 31 55374 6 74182 50 11205 39 808 66 8446 27 38250 5 77...
output:
2611984
result:
ok 1 number(s): "2611984"
Test #7:
score: 2
Accepted
time: 3ms
memory: 30600kb
input:
4 66 66 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 24 7 12 3 6 19 28 45 30 18 10 50 34 58 13 63 62 64 66408 38 81306 38 76367 14 63364 13 25358 56 52456 59 22480 54 1586 32 88869 61 70293 36 63360 51 48806 ...
output:
2817954
result:
ok 1 number(s): "2817954"
Test #8:
score: 2
Accepted
time: 0ms
memory: 28592kb
input:
4 66 66 0 1 2 1 4 5 3 6 8 9 7 10 11 12 13 15 14 17 18 16 19 20 21 23 22 24 25 25 25 25 25 25 25 25 25 25 25 25 25 26 26 26 26 26 26 26 26 26 26 26 26 26 15 15 23 28 20 2 42 48 51 16 7 19 58 47 31 89942 65 66178 14 46664 27 60218 4 92822 45 64969 10 11089 56 28103 45 79709 15 21700 48 87186 1 99586 4...
output:
2963026
result:
ok 1 number(s): "2963026"
Test #9:
score: 2
Accepted
time: 0ms
memory: 28832kb
input:
5 2333 2333 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
102630666
result:
ok 1 number(s): "102630666"
Test #10:
score: 2
Accepted
time: 0ms
memory: 30708kb
input:
5 2333 2333 0 1 1 2 3 5 4 6 8 7 10 11 12 13 14 15 9 16 17 19 20 18 21 22 23 25 26 27 28 29 30 24 31 32 33 35 36 34 37 39 38 41 42 40 44 43 45 47 48 49 50 51 52 46 54 53 55 57 56 59 58 60 61 63 64 65 62 67 66 68 69 70 72 73 71 74 75 77 78 76 80 81 82 83 84 79 86 85 88 89 90 87 91 93 94 92 95 97 98 96...
output:
97653563
result:
ok 1 number(s): "97653563"
Test #11:
score: 2
Accepted
time: 8ms
memory: 30436kb
input:
5 2333 2333 0 1 2 1 4 5 6 7 3 9 8 11 10 12 14 13 16 17 15 19 18 20 21 23 22 24 26 25 28 27 29 31 30 33 32 34 36 37 38 35 39 40 42 43 41 45 46 47 44 48 49 51 50 53 54 52 55 56 58 57 59 60 62 61 64 65 63 67 68 66 70 71 69 72 73 74 76 77 75 78 80 79 82 83 81 84 85 86 88 87 89 91 92 93 94 90 96 97 98 95...
output:
96687896
result:
ok 1 number(s): "96687896"
Test #12:
score: 2
Accepted
time: 110ms
memory: 43208kb
input:
6 100000 100000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 ...
output:
5007624082
result:
ok 1 number(s): "5007624082"
Test #13:
score: 2
Accepted
time: 122ms
memory: 43916kb
input:
6 100000 100000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 ...
output:
4984117401
result:
ok 1 number(s): "4984117401"
Test #14:
score: 2
Accepted
time: 111ms
memory: 43860kb
input:
6 100000 100000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 ...
output:
4996416696
result:
ok 1 number(s): "4996416696"
Test #15:
score: 2
Accepted
time: 102ms
memory: 38848kb
input:
7 100000 100000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 ...
output:
4401773488
result:
ok 1 number(s): "4401773488"
Test #16:
score: 2
Accepted
time: 131ms
memory: 36100kb
input:
7 100000 100000 0 1 1 2 3 5 4 7 8 6 9 10 11 13 14 15 12 17 18 19 20 16 21 23 22 24 25 27 28 29 26 31 30 33 32 34 36 37 35 38 40 39 41 43 42 44 45 46 47 48 49 51 50 52 53 55 54 57 58 59 60 56 62 63 61 64 66 67 68 69 70 65 71 73 72 75 74 76 77 79 80 81 82 83 78 84 86 85 87 88 89 91 92 93 90 94 95 97 9...
output:
4274252146
result:
ok 1 number(s): "4274252146"
Test #17:
score: 2
Accepted
time: 109ms
memory: 38768kb
input:
7 100000 100000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 ...
output:
4409489220
result:
ok 1 number(s): "4409489220"
Test #18:
score: 2
Accepted
time: 136ms
memory: 35152kb
input:
7 100000 100000 0 1 1 3 2 4 6 5 7 9 8 10 11 12 13 15 14 17 18 16 19 20 21 23 24 22 26 25 28 29 27 31 32 33 34 35 30 37 36 39 40 38 42 43 41 44 45 46 47 49 48 50 51 52 53 54 56 57 55 59 60 61 58 63 62 65 66 64 67 69 70 71 68 72 74 73 76 75 78 79 80 77 82 81 83 85 84 86 87 89 88 91 90 93 94 95 96 97 9...
output:
4269079003
result:
ok 1 number(s): "4269079003"
Test #19:
score: 2
Accepted
time: 18ms
memory: 30744kb
input:
8 2333 2333 2333 1 1 2 3 4 5 6 8 7 9 10 11 12 14 13 16 15 18 17 20 19 22 23 21 24 26 25 28 29 27 31 30 33 32 35 36 37 38 39 34 41 42 43 40 45 44 47 48 46 50 51 49 52 54 55 53 57 56 59 60 61 62 63 58 64 66 65 67 68 69 70 72 71 74 73 75 77 76 78 79 81 82 80 83 85 86 87 84 88 90 89 92 91 94 93 96 97 98...
output:
99979267 100054337 100122653 100122653 100146948 100163747 100231801 100281851 100324742 100379011 100414062 100474086 100493991 100493991 100514107 100578193 100653878 100653878 100689857 100689857 100728819 100811328 100822223 100919488 101017548 101017548 101068090 101147990 101214127 101214127 1...
result:
ok 2334 numbers
Test #20:
score: 2
Accepted
time: 13ms
memory: 30944kb
input:
8 2333 2333 2333 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 9...
output:
104491980 104545093 104560893 104560893 104598723 104635982 104713085 104752228 104752228 104808338 104813847 104843792 104885555 104885555 104914555 104943031 104990685 104990685 104990685 104994921 104994921 105082493 105082493 105117287 105162830 105171938 105171938 105171938 105240478 105240478 ...
result:
ok 2334 numbers
Test #21:
score: 2
Accepted
time: 17ms
memory: 30684kb
input:
8 2333 2333 2333 1 1 3 4 2 5 7 8 6 9 10 12 13 14 15 11 17 18 19 16 20 22 21 24 23 25 26 27 29 30 28 31 33 32 35 34 37 36 39 38 40 41 43 42 45 44 47 46 49 48 50 51 52 53 55 56 54 57 58 59 60 62 61 64 63 66 67 65 68 70 69 72 71 74 73 76 75 78 79 80 77 81 83 84 82 85 87 86 89 88 91 90 92 93 95 94 96 97...
output:
98368021 98430847 98478927 98478927 98478927 98567127 98654244 98738436 98811995 98816088 98880638 98910368 98910368 99007292 99007292 99057689 99067685 99087776 99181932 99207504 99207504 99235236 99235236 99287459 99376027 99421695 99490280 99511438 99536733 99570314 99570314 99598686 99632604 997...
result:
ok 2334 numbers
Test #22:
score: 2
Accepted
time: 1231ms
memory: 50120kb
input:
9 100000 100000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 9...
output:
4983791224 4983840545 4983850512 4983851410 4983923005 4983977112 4984052170 4984063836 4984130680 4984140629 4984224361 4984323238 4984386454 4984430318 4984523551 4984621371 4984693390 4984708978 4984753944 4984779478 4984804419 4984892565 4984935901 4984939240 4985000757 4985001532 4985044637 498...
result:
ok 100001 numbers
Test #23:
score: 2
Accepted
time: 1219ms
memory: 49904kb
input:
9 100000 100000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 9...
output:
5001930424 5002006599 5002017806 5002086058 5002108731 5002173748 5002237965 5002295437 5002362344 5002440802 5002450076 5002540998 5002576245 5002626568 5002717208 5002730667 5002827176 5002873718 5002933111 5002977389 5003025745 5003061710 5003142964 5003178260 5003246159 5003325766 5003376644 500...
result:
ok 100001 numbers
Test #24:
score: 2
Accepted
time: 1223ms
memory: 50128kb
input:
9 100000 100000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 9...
output:
4992694782 4992697594 4992768009 4992804380 4992840561 4992874444 4992885619 4992955737 4992995322 4993084112 4993118702 4993202606 4993267662 4993314974 4993326745 4993422669 4993517838 4993529103 4993611232 4993633389 4993713983 4993739162 4993799728 4993799728 4993873588 4993890012 4993958720 499...
result:
ok 100001 numbers
Test #25:
score: 2
Accepted
time: 1271ms
memory: 43176kb
input:
10 100000 100000 100000 1 1 2 3 4 5 7 8 9 6 10 12 11 13 14 15 16 18 17 20 19 21 23 24 22 26 27 25 29 28 30 31 32 34 33 36 35 38 39 40 41 37 43 44 45 46 47 42 49 48 50 51 52 53 55 54 56 58 57 60 59 62 63 61 64 66 67 65 68 70 69 71 73 74 75 72 77 78 79 80 76 81 82 83 84 85 87 86 88 89 91 90 92 94 93 9...
output:
4256469136 4256479367 4256537016 4256586070 4256586070 4256606041 4256661130 4256703528 4256703528 4256706219 4256706219 4256707808 4256708744 4256765916 4256774063 4256789242 4256881443 4256904525 4256904525 4256913970 4256981179 4257075589 4257075589 4257131373 4257131373 4257162300 4257202889 425...
result:
ok 100001 numbers
Test #26:
score: 2
Accepted
time: 1291ms
memory: 43280kb
input:
10 100000 100000 100000 1 2 1 4 5 3 6 7 8 9 10 12 13 11 14 16 17 15 18 20 21 19 22 24 25 26 23 28 27 30 31 29 33 34 35 32 37 38 39 40 41 36 42 44 45 43 46 47 48 49 51 52 50 54 55 56 57 53 59 60 58 61 62 63 64 66 65 68 69 70 67 72 71 74 73 76 75 78 79 77 80 81 82 83 84 85 86 87 88 89 90 91 92 94 95 9...
output:
4276569611 4276569611 4276582468 4276632349 4276668691 4276681073 4276780133 4276780133 4276780133 4276789961 4276880969 4276939509 4276939509 4276939509 4276978803 4277060812 4277078795 4277115114 4277128646 4277130724 4277212137 4277302241 4277367149 4277424908 4277477489 4277477489 4277477489 427...
result:
ok 100001 numbers
Test #27:
score: 2
Accepted
time: 1251ms
memory: 43280kb
input:
10 100000 100000 100000 1 2 3 4 5 6 7 1 8 10 11 12 9 13 14 16 15 17 19 20 18 22 23 24 25 26 21 27 29 28 30 32 31 34 33 36 35 37 39 38 41 40 42 44 43 45 46 47 49 48 51 52 53 54 50 55 56 58 59 57 61 60 62 64 63 65 66 68 69 67 70 72 73 71 74 76 77 75 79 78 81 82 83 84 85 80 87 88 86 89 90 92 93 94 91 9...
output:
4267106136 4267111654 4267111654 4267111654 4267133068 4267137860 4267137860 4267137860 4267212849 4267212849 4267212849 4267212849 4267212849 4267284038 4267298096 4267394121 4267489771 4267506558 4267506558 4267506558 4267536639 4267589669 4267589669 4267616634 4267709064 4267719435 4267721310 426...
result:
ok 100001 numbers
Test #28:
score: 2
Accepted
time: 1222ms
memory: 42684kb
input:
10 100000 100000 100000 1 1 3 4 2 6 5 7 8 9 11 12 10 14 15 13 17 16 18 20 19 22 21 23 25 24 26 28 29 30 27 32 31 33 34 35 37 36 38 39 41 40 43 42 45 44 46 47 49 50 48 51 53 52 54 56 57 55 58 59 61 60 63 62 64 65 67 66 69 68 71 72 73 70 75 74 76 77 79 80 81 82 83 78 84 86 87 88 89 90 91 92 93 94 85 9...
output:
4272572529 4272605070 4272627196 4272668757 4272668757 4272765959 4272860320 4272907505 4272915280 4272948439 4272998675 4273075275 4273121096 4273137437 4273168084 4273218290 4273218290 4273257296 4273319451 4273386977 4273404052 4273404052 4273439925 4273468865 4273568376 4273663940 4273699430 427...
result:
ok 100001 numbers
Test #29:
score: 2
Accepted
time: 8ms
memory: 28924kb
input:
11 2333 2333 2333 1 1 2 3 4 5 7 6 8 10 9 12 13 14 15 16 17 11 19 20 18 22 21 24 23 25 26 28 27 29 31 32 30 33 35 36 34 38 37 39 40 41 43 42 45 46 44 47 49 50 51 52 53 54 48 55 56 58 59 57 60 61 63 64 65 66 62 68 67 69 70 72 71 74 75 76 73 77 79 80 81 78 83 82 85 86 87 84 88 90 91 92 93 94 95 96 97 9...
output:
98346715 98320738 98374109 98374109 98356862 98380497 98400545 98396852 98402318 98441468 98463438 98423019 98388518 98388518 98388518 98460607 98460607 98428423 98428423 98424987 98424987 98409507 98409507 98409507 98409507 98428586 98520686 98520686 98432315 98449552 98421842 98368486 98465997 983...
result:
ok 2334 numbers
Test #30:
score: 2
Accepted
time: 13ms
memory: 28916kb
input:
11 2333 2333 2333 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 ...
output:
99522112 99566564 99502944 99481645 99446700 99438739 99520155 99474582 99474582 99384439 99384439 99430696 99365433 99365433 99373929 99373929 99384771 99304914 99357340 99271857 99271857 99226504 99237934 99237934 99151132 99159556 99197865 99201840 99153129 99126696 99126696 99039774 99039774 990...
result:
ok 2334 numbers
Test #31:
score: 2
Accepted
time: 15ms
memory: 28900kb
input:
11 2333 2333 2333 1 1 3 4 2 5 6 7 9 10 11 8 13 12 14 15 16 17 19 20 18 22 23 24 25 21 27 28 29 30 26 32 33 34 35 31 37 38 36 39 40 42 41 44 43 45 47 48 46 49 50 52 53 54 55 51 57 58 56 59 61 60 62 64 65 63 67 66 68 70 71 69 72 74 75 76 77 73 79 78 80 82 81 84 83 85 86 87 89 90 88 91 93 94 92 95 97 9...
output:
98318975 98405504 98379386 98404489 98318159 98289544 98332067 98414460 98410844 98377307 98470189 98452976 98452976 98529202 98520785 98541735 98569251 98570871 98570871 98571961 98567552 98648351 98624658 98624658 98666011 98671101 98679273 98679273 98679273 98628401 98667033 98667033 98706817 986...
result:
ok 2334 numbers
Test #32:
score: 2
Accepted
time: 589ms
memory: 46008kb
input:
12 100000 100000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ...
output:
82625 82625 82624 82624 82623 82624 82624 82625 82624 82625 82625 82626 82627 82628 82628 82629 82628 82628 82627 82627 82628 82628 82629 82628 82629 82630 82629 82630 82630 82629 82630 82629 82628 82629 82628 82628 82629 82630 82630 82630 82630 82629 82628 82628 82627 82627 82628 82628 82628 82629 ...
result:
ok 100001 numbers
Test #33:
score: 2
Accepted
time: 456ms
memory: 45172kb
input:
12 100000 100000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ...
output:
82796 82796 82797 82798 82798 82799 82800 82801 82802 82803 82804 82805 82806 82807 82807 82808 82808 82808 82808 82809 82810 82810 82811 82812 82812 82812 82812 82813 82813 82814 82815 82816 82817 82817 82818 82818 82819 82820 82821 82822 82823 82824 82824 82825 82826 82826 82826 82827 82828 82829 ...
result:
ok 100001 numbers
Test #34:
score: 2
Accepted
time: 581ms
memory: 45900kb
input:
12 100000 100000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ...
output:
82783 82782 82783 82784 82783 82782 82782 82782 82781 82781 82781 82782 82782 82782 82783 82782 82781 82782 82783 82782 82781 82781 82782 82782 82781 82781 82782 82783 82782 82782 82783 82782 82783 82783 82782 82782 82783 82783 82783 82783 82782 82782 82781 82780 82779 82779 82779 82778 82777 82776 ...
result:
ok 100001 numbers
Test #35:
score: 2
Accepted
time: 871ms
memory: 50224kb
input:
13 100000 100000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ...
output:
4980366937 4980323023 4980291984 4980308351 4980310052 4980338501 4980260106 4980233673 4980271036 4980215946 4980247506 4980224143 4980140771 4980091199 4980050081 4980054096 4980099681 4980165146 4980122981 4980114331 4980098027 4980123658 4980095314 4980190496 4980203081 4980130411 4980083954 498...
result:
ok 100001 numbers
Test #36:
score: 2
Accepted
time: 984ms
memory: 50184kb
input:
13 100000 100000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ...
output:
4994181299 4994199567 4994296916 4994341409 4994258807 4994334972 4994354627 4994320484 4994307621 4994303947 4994243441 4994310817 4994292675 4994211943 4994310495 4994242753 4994170086 4994151211 4994124020 4994120808 4994186633 4994106520 4994019241 4994052169 4994081265 4994132791 4994168081 499...
result:
ok 100001 numbers
Test #37:
score: 2
Accepted
time: 900ms
memory: 50936kb
input:
13 100000 100000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ...
output:
5000749094 5000794377 5000892758 5000904958 5000928698 5000991728 5000969920 5000960366 5001023591 5001019706 5001013598 5001110465 5001185815 5001132402 5001158558 5001257410 5001271583 5001308714 5001251012 5001293735 5001372991 5001367360 5001372380 5001460572 5001541954 5001518591 5001489461 500...
result:
ok 100001 numbers
Test #38:
score: 2
Accepted
time: 840ms
memory: 50956kb
input:
13 100000 100000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ...
output:
5007627660 5007559765 5007591097 5007526656 5007455841 5007486709 5007501596 5007428399 5007359746 5007357945 5007373460 5007355863 5007445898 5007507062 5007560004 5007633180 5007541231 5007470920 5007494570 5007408631 5007430588 5007475703 5007436875 5007345282 5007391728 5007449468 5007384329 500...
result:
ok 100001 numbers
Test #39:
score: 2
Accepted
time: 650ms
memory: 40548kb
input:
14 66666 66666 66666 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ...
output:
2936083439 2936143313 2936179079 2936257511 2936273083 2936359492 2936387580 2936430141 2936500354 2936500354 2936534787 2936534787 2936534787 2936631512 2936682065 2936761932 2936763538 2936763538 2936783481 2936788766 2936788766 2936857137 2936874629 2936918813 2936989311 2937064125 2937129956 293...
result:
ok 66667 numbers
Test #40:
score: 2
Accepted
time: 614ms
memory: 38980kb
input:
14 66666 66666 66666 1 2 1 4 3 5 7 8 9 10 6 11 12 14 13 15 17 18 19 16 21 20 22 23 25 26 27 24 28 30 31 29 33 32 34 36 37 35 38 39 41 42 43 40 45 44 47 46 49 50 51 48 53 54 55 52 57 56 59 60 58 62 61 63 64 65 66 67 68 69 70 72 71 74 75 76 77 73 79 80 81 78 83 82 85 84 86 87 88 90 89 92 93 91 95 96 9...
output:
2845059678 2845111971 2845124286 2845075440 2844993717 2844917477 2844894352 2844879104 2844822273 2844853428 2844847886 2844835182 2844742603 2844759241 2844829657 2844875374 2844864712 2844911140 2844989312 2844989312 2844966825 2844966825 2844986024 2844986024 2844963247 2844889996 2844819155 284...
result:
ok 66667 numbers
Test #41:
score: 2
Accepted
time: 610ms
memory: 38012kb
input:
14 66666 66666 66666 1 1 2 4 5 3 6 8 7 10 9 11 13 14 12 15 17 16 18 19 21 22 23 20 24 25 27 26 28 30 31 32 29 33 35 34 36 38 37 40 41 42 39 43 45 44 46 47 49 50 51 52 48 53 55 56 54 58 59 60 57 62 61 63 64 66 67 65 68 70 71 72 73 74 69 75 76 77 79 78 80 81 83 84 82 86 85 88 89 87 91 90 92 93 95 96 9...
output:
2855673525 2855697425 2855697425 2855787823 2855751122 2855751234 2855681434 2855692490 2855789367 2855719295 2855686577 2855691605 2855601210 2855639521 2855729836 2855790539 2855855044 2855881661 2855938223 2855954372 2855958133 2855866229 2855783621 2855737921 2855700675 2855628327 2855581804 285...
result:
ok 66667 numbers
Test #42:
score: 2
Accepted
time: 474ms
memory: 39856kb
input:
14 66666 66666 66666 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ...
output:
2944133418 2944164060 2944164060 2944215039 2944129501 2944125775 2944113913 2944191819 2944277785 2944277785 2944253573 2944338702 2944331613 2944318397 2944285856 2944309537 2944318471 2944271299 2944238476 2944268295 2944289713 2944196078 2944196078 2944119675 2944165920 2944264501 2944246469 294...
result:
ok 66667 numbers
Test #43:
score: 2
Accepted
time: 647ms
memory: 40264kb
input:
14 66666 66666 66666 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ...
output:
2936334256 2936343270 2936379950 2936392856 2936488574 2936573827 2936594329 2936615492 2936711648 2936719714 2936719714 2936721553 2936820143 2936821253 2936853738 2936883303 2936958428 2937055781 2937073818 2937100600 2937126340 2937178502 2937268348 2937350069 2937350069 2937369534 2937374000 293...
result:
ok 66667 numbers
Test #44:
score: 2
Accepted
time: 462ms
memory: 39700kb
input:
14 66666 66666 66666 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ...
output:
2934715875 2934760198 2934764898 2934834174 2934902091 2934948374 2935012022 2935029392 2934984052 2934909487 2934815542 2934846139 2934868671 2934923969 2934985655 2935006553 2935006553 2935006553 2935006553 2934932004 2934884866 2934895565 2934895565 2934845242 2934869041 2934919247 2934942033 293...
result:
ok 66667 numbers
Test #45:
score: 2
Accepted
time: 986ms
memory: 43080kb
input:
15 100000 100000 100000 1 2 3 4 1 5 6 8 7 9 11 12 10 14 13 16 15 18 17 19 21 20 23 22 25 24 27 28 29 26 31 32 33 30 35 34 37 36 39 38 41 40 42 44 43 45 46 47 48 50 49 51 53 52 54 55 56 57 59 60 61 58 62 63 65 66 64 68 69 67 71 72 70 74 75 76 77 73 79 80 78 82 81 83 85 84 87 86 89 90 88 92 93 94 95 9...
output:
4261432590 4261347658 4261403578 4261415625 4261452389 4261452389 4261415364 4261415364 4261436857 4261436857 4261467046 4261503436 4261503436 4261550432 4261550432 4261550432 4261550432 4261626801 4261626801 4261643583 4261637931 4261695005 4261633280 4261627598 4261591140 4261688099 4261688099 426...
result:
ok 100001 numbers
Test #46:
score: 2
Accepted
time: 993ms
memory: 42140kb
input:
15 100000 100000 100000 1 2 3 1 4 6 7 5 8 10 11 12 13 14 9 16 17 18 19 15 21 20 22 24 25 26 23 27 29 28 31 30 32 34 35 33 37 38 39 36 41 42 40 44 45 43 46 48 49 50 51 52 53 47 55 56 54 57 59 58 60 61 62 64 65 66 67 63 69 68 71 72 73 70 75 76 74 78 79 80 81 82 77 84 83 85 86 87 88 89 90 91 93 94 92 9...
output:
4255471314 4255482697 4255403142 4255397455 4255399228 4255392113 4255392113 4255318073 4255318073 4255318073 4255383872 4255335872 4255315988 4255341759 4255341759 4255342925 4255342925 4255299025 4255371988 4255391340 4255333807 4255333807 4255390585 4255411965 4255440591 4255501287 4255524474 425...
result:
ok 100001 numbers
Test #47:
score: 2
Accepted
time: 1268ms
memory: 43420kb
input:
15 100000 100000 100000 1 2 1 3 4 5 7 6 8 9 11 10 12 14 15 13 17 16 19 20 18 21 23 24 22 25 26 27 29 28 30 32 31 34 33 36 35 37 39 40 41 42 38 43 44 46 47 48 45 49 50 52 53 54 55 51 56 57 59 60 58 62 63 61 65 66 67 68 69 70 64 72 71 74 75 73 76 78 79 80 81 77 82 83 85 86 87 84 89 90 88 91 92 94 93 9...
output:
4263894872 4263906678 4263973098 4264011379 4264053071 4264077729 4264081386 4264100912 4264116944 4264141602 4264182615 4264237836 4264330986 4264330986 4264412594 4264446877 4264446877 4264453161 4264545883 4264605278 4264640490 4264713244 4264770455 4264771115 4264771115 4264870721 4264881612 426...
result:
ok 100001 numbers
Test #48:
score: 2
Accepted
time: 1259ms
memory: 43400kb
input:
15 100000 100000 100000 1 1 3 2 5 6 4 7 9 8 10 12 13 14 15 16 17 11 18 20 19 22 21 24 23 26 27 25 29 28 31 32 30 34 33 35 36 38 37 39 40 42 43 41 44 46 45 48 47 49 50 51 52 53 55 54 57 56 59 60 58 61 63 64 62 66 65 68 67 70 71 69 73 74 72 75 76 77 79 78 81 82 83 80 85 86 84 87 89 90 91 92 88 94 95 9...
output:
4277723507 4277770423 4277797849 4277842276 4277930268 4277960665 4277982924 4277986264 4278025622 4278107881 4278107881 4278166292 4278173243 4278207866 4278274409 4278291282 4278327438 4278417992 4278445785 4278496314 4278578816 4278603899 4278614942 4278625305 4278625305 4278667667 4278669456 427...
result:
ok 100001 numbers
Test #49:
score: 2
Accepted
time: 986ms
memory: 43128kb
input:
15 100000 100000 100000 1 2 3 4 5 1 7 6 8 9 11 12 13 10 15 16 14 17 19 18 21 22 20 24 23 26 25 28 27 30 29 32 31 34 33 35 37 36 38 40 39 41 42 43 45 46 44 48 47 49 51 50 53 54 55 56 52 58 59 57 60 62 63 61 64 66 67 65 68 70 69 72 73 71 75 76 77 78 79 74 81 80 83 82 84 86 87 85 89 88 91 92 90 94 93 9...
output:
4250187762 4250200917 4250294941 4250381324 4250381324 4250297272 4250216812 4250216812 4250138636 4250175622 4250111196 4250111196 4250111196 4250120743 4250197253 4250197253 4250168978 4250235194 4250142689 4250184133 4250175665 4250170268 4250200610 4250214188 4250150259 4250150259 4250206624 425...
result:
ok 100001 numbers
Test #50:
score: 2
Accepted
time: 1013ms
memory: 43032kb
input:
15 100000 100000 100000 1 1 2 4 5 3 6 7 9 8 11 12 10 13 15 16 17 14 18 19 21 22 23 24 25 20 26 27 29 30 31 32 33 28 34 35 37 38 36 40 39 42 41 43 45 46 44 47 49 50 48 52 53 51 55 54 57 56 58 59 61 62 63 64 60 66 65 68 69 70 71 72 67 74 75 73 77 76 79 78 80 81 83 84 85 82 87 86 88 89 91 90 93 94 95 9...
output:
4270838194 4270838194 4270838194 4270838194 4270842480 4270869856 4270897009 4270897009 4270825273 4270825273 4270789063 4270767304 4270767304 4270852265 4270842540 4270916571 4270916874 4270851431 4270851431 4270872615 4270938087 4270954300 4270922365 4270922365 4271005129 4271034438 4271043576 427...
result:
ok 100001 numbers
Extra Test:
score: 0
Extra Test Passed