QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#523339 | #8212. Football in Osijek | UNos_maricones# | AC ✓ | 243ms | 116412kb | C++14 | 3.1kb | 2024-08-18 07:40:56 | 2024-08-18 07:40:56 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
const int N = 1e6;
const int mod = 1e9 + 7;
const int oo = N + 5;
typedef pair<int,int> pii;
typedef long long ll;
vector <int> g[N];
int fat[N];
pii lson[N];
void dfs (int u) {
lson[u] = {1, u};
for (auto &v : g[u]) {
dfs(v);
lson[u] = max(lson[u], {lson[v].ff + 1, lson[v].ss});
}
}
int main() {
#ifdef LOCAL
freopen("input.txt","r",stdin);
#endif // LOCAL
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n; cin >> n;
vector <int> a(n);
for (auto &e : a) cin >> e, e--;
vector <int> visi(n, 0);
vector <int> cyc(n, -1);
vector <vector <int>> sz(n);
vector <int> ans(n + 1, 0);
vector <int> pvisi(n, 0);
int cnt = 0;
for (int i = 0; i < n; ++i) {
if (visi[i]) continue;
int u = i;
vector <int> seen;
while (!visi[u]) {
visi[u] = 1;
seen.pb(u);
u = a[u];
}
if (!pvisi[u]) {
while (1) {
//assert(seen.size());
cyc[seen.back()] = cnt;
pvisi[seen.back()]=1;
if (seen.back() == u) break;
seen.pop_back();
}
cnt++;
}
for (auto &e : seen) pvisi[e] = 1;
}
for (int i = 0; i < n; ++i) {
if (cyc[i] == -1) continue;
sz[cyc[i]].pb(i);
}
for (int i = 0; i < n; ++i) {
if (cyc[i] == -1) {
fat[i] = a[i];
g[a[i]].pb(i);
}
}
for (int i = 0; i < n; ++i) {
if (cyc[i] != -1) {
dfs(i);
}
}
for (int i = 0; i < cnt; ++i) {
pii lrg = {-1,-1};
for (auto &j : sz[i]) {
lrg = max(lrg, {lson[j].ff, j});
}
int u = lrg.ss;
while (a[u] != lrg.ss) {
fat[u] = a[u];
g[a[u]].pb(u);
cyc[u] = -1;
u = a[u];
}
}
priority_queue <pii> pq;
vector <int> nzer(n + 1, 0);
for (int i = 0; i < n; ++i) {
if (cyc[i] != -1) {
dfs(i);
pq.push({lson[i].ff, i});
nzer[(int)sz[cyc[i]].size()]++;
nzer[lson[i].ff + 1]--;
}
}
for (int i = 1; i <= n; ++i) nzer[i] += nzer[i - 1];
int curr_size = 0;
int curr_ans = 0;
for (int i = 1; i <= n; ++i) {
while (curr_size < i) {
//cout << "=> " << curr_size << endl;
pii curr = pq.top(); pq.pop();
curr_size += curr.ff;
int son = lson[curr.ss].ss;
int u = fat[son];
if (son != curr.ss) {
int it = 0;
while (1) {
it++;
assert(it <= curr.ff + 20);
//cout << u << '\n';
for (auto &v : g[u]) {
if (v == son) continue;
pq.push({lson[v].ff, v});
}
if (u == curr.ss) break;
son = u;
u = fat[u];
}
}
curr_ans++;
}
ans[i] = curr_ans - 1;
}
for (int i = 1; i <= n; ++i) {
if (ans[i] == 0 && nzer[i] == 0) cout << 1 << " ";
else cout << ans[i] << " ";
}
cout << '\n';
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 30904kb
input:
5 2 3 1 3 5
output:
0 1 0 0 1
result:
ok 5 number(s): "0 1 0 0 1"
Test #2:
score: 0
Accepted
time: 0ms
memory: 27772kb
input:
1 1
output:
0
result:
ok 1 number(s): "0"
Test #3:
score: 0
Accepted
time: 7ms
memory: 30616kb
input:
2 2 2
output:
0 0
result:
ok 2 number(s): "0 0"
Test #4:
score: 0
Accepted
time: 3ms
memory: 30920kb
input:
10 4 7 2 8 4 3 4 9 7 3
output:
1 1 1 0 0 0 0 1 2 3
result:
ok 10 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 29964kb
input:
10 8 7 4 8 3 4 2 5 3 7
output:
1 0 0 0 0 1 1 1 2 3
result:
ok 10 numbers
Test #6:
score: 0
Accepted
time: 3ms
memory: 29492kb
input:
10 7 1 4 1 6 1 1 10 5 7
output:
1 0 0 0 0 1 1 2 2 3
result:
ok 10 numbers
Test #7:
score: 0
Accepted
time: 3ms
memory: 29628kb
input:
10 5 6 1 3 6 4 3 9 3 2
output:
1 1 1 1 0 0 0 1 1 2
result:
ok 10 numbers
Test #8:
score: 0
Accepted
time: 3ms
memory: 29940kb
input:
10 10 4 3 6 5 10 7 5 6 6
output:
0 0 0 0 1 1 2 3 4 5
result:
ok 10 numbers
Test #9:
score: 0
Accepted
time: 0ms
memory: 30920kb
input:
10 10 9 10 10 8 3 5 10 2 5
output:
1 0 0 0 0 1 1 2 3 4
result:
ok 10 numbers
Test #10:
score: 0
Accepted
time: 0ms
memory: 30776kb
input:
10 1 9 7 6 2 4 7 8 1 3
output:
0 0 0 0 1 1 1 2 2 3
result:
ok 10 numbers
Test #11:
score: 0
Accepted
time: 0ms
memory: 30580kb
input:
10 3 9 4 10 9 5 5 1 3 2
output:
1 1 1 1 0 0 0 1 1 2
result:
ok 10 numbers
Test #12:
score: 0
Accepted
time: 7ms
memory: 29696kb
input:
100 55 62 70 100 90 98 69 1 93 8 98 86 12 1 47 95 12 35 38 59 57 60 54 34 12 17 34 51 70 32 92 47 22 42 55 88 19 74 58 43 56 80 67 86 30 14 93 87 93 58 19 19 59 82 30 68 56 87 55 92 29 87 19 71 65 40 20 65 43 94 22 62 77 40 4 32 90 88 7 40 86 30 59 9 25 93 38 20 59 23 79 10 71 92 72 25 59 86 72 44
output:
0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 8 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 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
result:
ok 100 numbers
Test #13:
score: 0
Accepted
time: 0ms
memory: 31228kb
input:
1000 108 318 583 10 344 396 385 989 298 514 936 308 167 510 61 175 760 840 33 576 481 535 643 128 682 755 693 51 209 228 79 56 111 10 179 538 398 530 751 337 770 160 790 506 901 735 367 299 760 58 205 896 729 615 213 593 767 375 723 97 272 552 181 305 693 707 886 202 400 462 725 87 332 434 707 217 5...
output:
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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 ...
result:
ok 1000 numbers
Test #14:
score: 0
Accepted
time: 3ms
memory: 30800kb
input:
10000 8466 8125 3435 8586 3368 6364 6214 8960 2364 2387 4607 3236 8618 6499 1662 2415 7751 8495 1984 3727 6713 6526 5478 7446 1114 5229 5268 8714 4041 9738 819 6324 328 6874 2655 2673 9663 7667 4809 8660 4920 3059 6470 322 8945 1015 4766 1892 7037 9541 5502 4168 2851 5491 2550 4993 9885 1117 5436 74...
output:
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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 10000 numbers
Test #15:
score: 0
Accepted
time: 37ms
memory: 40188kb
input:
100000 89736 90728 95214 56421 59309 36615 29493 69816 65743 86382 7094 42018 28261 7523 64050 99816 26139 7011 98078 65853 84622 85470 47458 72747 77008 42294 49212 1553 2794 70980 13082 53696 11317 19251 1987 15965 14848 45027 80911 6851 34830 91975 3178 2174 8533 35176 27893 61328 3295 57023 7078...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 ...
result:
ok 100000 numbers
Test #16:
score: 0
Accepted
time: 73ms
memory: 48364kb
input:
200000 15136 43638 172383 6589 42364 26506 86708 33565 32298 2140 104626 6147 112684 106455 3861 62177 180185 27354 44651 5922 85017 16759 117594 93474 120042 190324 152024 171698 93854 134285 88626 97878 91419 123632 155398 78342 67801 162879 92936 82736 110376 192466 146753 163060 17127 139122 382...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 200000 numbers
Test #17:
score: 0
Accepted
time: 110ms
memory: 53292kb
input:
300000 248727 238625 33448 169223 121934 209881 193446 156493 65642 230647 81702 145630 87210 102610 165536 14973 238945 230552 108740 68192 232183 152168 45457 47153 130600 294649 286335 299281 129635 262962 6902 253328 284523 191279 112917 15702 26650 253987 273484 80574 147225 14832 236866 256949...
output:
0 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 1 1 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 ...
result:
ok 300000 numbers
Test #18:
score: 0
Accepted
time: 152ms
memory: 64092kb
input:
400000 98318 300047 10618 95199 204989 99772 359174 363347 132197 13701 344642 101246 295825 25734 162243 310038 125695 375086 55313 316773 332578 283457 215593 192072 73633 142679 264956 379825 20695 202074 149742 64806 388817 228364 290519 302271 355411 180351 61317 156459 90067 239515 80440 18513...
output:
0 1 1 1 1 1 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 0 0 0 0 0 0 0 ...
result:
ok 400000 numbers
Test #19:
score: 0
Accepted
time: 243ms
memory: 71788kb
input:
500000 323718 428765 255083 245367 344940 498175 424901 27097 222944 229460 374878 465374 80247 424666 302053 348208 479741 62725 334590 189547 257165 225146 318433 12799 416667 290708 367769 349970 187562 341187 325285 41691 368918 122344 143930 164648 208364 330907 240639 223833 465613 72709 12401...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 500000 numbers
Test #20:
score: 0
Accepted
time: 159ms
memory: 116412kb
input:
500000 6793 357638 314719 184214 199835 486220 218127 169687 307921 254992 468003 187381 160435 202839 57105 250619 365015 330330 25338 329585 460199 180164 6623 475821 307073 6 416064 308261 125988 227802 94874 166649 235528 338315 53026 236000 436754 442525 44 319072 306782 228596 55510 372601 177...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 500000 numbers
Test #21:
score: 0
Accepted
time: 208ms
memory: 68504kb
input:
500000 185314 274666 88620 293705 202376 497688 229011 429489 247697 40841 33042 370406 396081 171120 156245 334701 314756 108315 128206 55419 164079 240075 303330 403423 443896 419487 436140 191941 901 294321 206074 311731 393826 235133 333943 293285 388094 95037 326228 445766 156694 106285 446897 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ...
result:
ok 500000 numbers
Test #22:
score: 0
Accepted
time: 172ms
memory: 68540kb
input:
500000 285894 12098 7403 372688 435692 389242 115104 367957 197488 10368 39509 400287 120312 394490 283729 345809 345032 332405 438947 153613 208856 25976 261460 344001 3166 430402 431153 318228 408552 393830 189132 310757 444302 156838 47426 128365 29340 113795 495887 262608 228024 33890 366705 233...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ...
result:
ok 500000 numbers
Test #23:
score: 0
Accepted
time: 129ms
memory: 68184kb
input:
500000 1 297523 297523 297523 174405 345792 345792 345792 217022 174405 345792 217022 345792 174405 345792 345792 174405 217022 345792 217022 345792 174405 174405 174405 193418 473540 217022 345792 345792 174405 217022 345792 174405 345792 345792 473540 174405 174405 217022 345792 297523 345792 1687...
output:
0 0 0 0 0 1 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 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 ...
result:
ok 500000 numbers
Test #24:
score: 0
Accepted
time: 119ms
memory: 67952kb
input:
500000 1 499128 414070 12256 12256 414070 499128 499128 499128 414070 298091 499128 499128 298091 499128 298091 414070 499128 499128 499128 499128 298091 499128 298091 499128 12256 414070 298091 414070 499128 298091 298091 298091 499128 414070 499128 499128 414070 499128 499128 499128 499128 414070 ...
output:
0 0 0 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 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...
result:
ok 500000 numbers
Test #25:
score: 0
Accepted
time: 112ms
memory: 67320kb
input:
500000 1 31694 311804 31694 311804 68353 31694 311804 31694 485977 31694 68353 31694 31694 68353 311804 311804 386033 68353 68353 311804 386033 68353 311804 70357 134150 134150 311804 68353 68353 68353 31694 68353 68353 68353 386033 31694 68353 68353 311804 311804 68353 68353 68353 68353 68353 68353...
output:
0 0 0 0 0 1 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 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 ...
result:
ok 500000 numbers
Test #26:
score: 0
Accepted
time: 117ms
memory: 67984kb
input:
500000 1 472997 472997 141236 141236 141236 141236 454851 141236 472997 141236 472997 472997 141236 268375 472997 472997 141236 472997 141236 105774 105774 105774 472997 141236 141236 472997 141236 472997 472997 141236 472997 472997 448561 472997 141236 141236 472997 141236 268375 448561 141236 1412...
output:
0 0 0 0 0 0 1 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 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 9...
result:
ok 500000 numbers
Test #27:
score: 0
Accepted
time: 117ms
memory: 67060kb
input:
500000 1 64355 411811 64355 64355 312627 64355 64355 64355 64355 64355 275312 275312 64355 411811 64355 275312 64355 64355 411811 312627 275312 64355 275312 411811 64355 64355 64355 64355 275312 312627 64355 64355 312627 64355 275312 64355 64355 64355 411811 64355 275312 64355 312627 312627 275312 2...
output:
0 0 0 0 0 1 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 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 ...
result:
ok 500000 numbers
Test #28:
score: 0
Accepted
time: 113ms
memory: 68448kb
input:
500000 1 170056 447861 316711 170056 447861 447861 447861 447861 355773 170056 447861 447861 447861 447861 447861 447861 447861 447861 316711 205841 447861 174871 447861 447861 170056 170056 447861 447861 205841 205841 447861 323668 205841 205841 205841 316711 447861 205841 316711 205841 447861 2058...
output:
0 0 0 0 0 1 1 1 2 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 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 9...
result:
ok 500000 numbers
Test #29:
score: 0
Accepted
time: 104ms
memory: 67900kb
input:
500000 1 371489 56872 56872 421734 56872 56872 56872 44114 56872 371489 56872 56872 56872 421734 371489 44114 56872 56872 56872 56872 44114 361633 44114 421734 56872 44114 72998 56872 56872 44114 56872 56872 421734 44114 56872 44114 56872 72998 56872 56872 72998 56872 56872 56872 56872 72998 56872 5...
output:
0 0 0 0 0 0 1 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 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 9...
result:
ok 500000 numbers
Test #30:
score: 0
Accepted
time: 100ms
memory: 67592kb
input:
500000 1 28347 28347 207329 28347 259136 207329 28347 28347 28347 259136 259136 259136 28347 259136 207329 259136 28347 259136 28347 47761 207329 259136 28347 207329 259136 28347 259136 28347 28347 259136 259136 28347 207329 28347 259136 259136 259136 259136 207329 191058 28347 207329 28347 259136 2...
output:
0 0 0 0 0 1 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 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 ...
result:
ok 500000 numbers
Test #31:
score: 0
Accepted
time: 115ms
memory: 68440kb
input:
500000 1 61312 228691 61312 61312 61312 150394 61312 61312 61312 61312 6379 58268 61312 58268 61312 228691 6379 150394 309370 61312 309370 6379 61312 150394 61312 61312 58268 61312 6379 61312 6379 58268 6379 6379 150394 6379 6379 61312 6379 61312 58268 61312 61312 61312 150394 61312 6379 6379 150394...
output:
0 0 0 0 0 1 1 1 2 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 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 9...
result:
ok 500000 numbers
Test #32:
score: 0
Accepted
time: 106ms
memory: 67668kb
input:
500000 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365 412365...
output:
1 0 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 99 100 10...
result:
ok 500000 numbers
Test #33:
score: 0
Accepted
time: 168ms
memory: 76456kb
input:
500000 85743 126295 340636 4 5 158554 57240 340636 157744 325647 95848 145739 68895 493624 160068 340636 44975 222838 19 394163 340636 340636 340636 340636 340636 340636 340636 499837 340636 417329 316194 63491 252222 205977 340636 340636 340636 349866 440150 402281 471750 42 43 392059 115677 120798...
output:
0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 10 10 10 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 13 13 14 14 14 14 14 15 15 15 15 15 16 16 16 16 16 17 17 17 17 17 18 18 18 18 18 19 19 19 19 19 20 20 20 20 20 21 21 21 21 21 22 22 22 22 22 23 23...
result:
ok 500000 numbers
Test #34:
score: 0
Accepted
time: 188ms
memory: 74504kb
input:
500000 99392 418978 99392 167350 364302 8563 28932 140536 266741 99392 99392 440330 481736 164264 157087 177172 29483 277447 358051 328722 185017 286918 347698 99392 262622 245821 27 122054 462040 430477 366221 32 99392 99392 235866 415381 179275 99392 246176 311922 41 127429 203376 446226 99392 408...
output:
0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 10 10 10 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 13 13 14 14 14 14 14 15 15 15 15 15 16 16 16 16 16 17 17 17 17 17 18 18 18 18 18 19 19 19 19 19 20 20 20 20 20 21 21 21 21 21 22 22 22 22 22 23 23...
result:
ok 500000 numbers
Test #35:
score: 0
Accepted
time: 179ms
memory: 74448kb
input:
500000 348897 2 137459 165384 169629 6 219156 390456 307728 18514 35406 489644 459670 313956 219156 274000 17 44730 469456 285762 219156 428080 364873 149833 168757 219156 347174 26893 337094 388393 351049 198076 107264 245924 219156 219963 8930 190121 219156 219156 41 26462 87300 219156 219156 1002...
output:
0 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 10 10 10 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 13 13 14 14 14 14 14 15 15 15 15 15 16 16 16 16 16 17 17 17 17 17 18 18 18 18 18 19 19 19 19 19 20 20 20 20 20 21 21 21 21 21 22 22 22 22 22 23 ...
result:
ok 500000 numbers
Test #36:
score: 0
Accepted
time: 181ms
memory: 68692kb
input:
500000 71661 199647 217084 227917 327862 336917 12247 84943 10049 51312 43848 56603 208955 61739 402561 427939 487183 351778 440551 456156 232575 70414 178929 245749 150010 494180 21958 174462 315718 415299 141263 225109 408995 117953 45131 335673 343954 360006 367108 231899 67188 103648 425817 2010...
output:
0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12...
result:
ok 500000 numbers
Extra Test:
score: 0
Extra Test Passed