QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#380944#8212. Football in Osijekucup-team1338#AC ✓158ms47564kbC++202.0kb2024-04-07 15:23:052024-04-07 15:23:05

Judging History

你现在查看的是最新测评结果

  • [2024-04-07 15:23:05]
  • 评测
  • 测评结果:AC
  • 用时:158ms
  • 内存:47564kb
  • [2024-04-07 15:23:05]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
const int N=500013;
typedef long long ll;
int a[N],in[N],R[N];
vector<int>mp[N];
int top[N],len[N];
void dfs(int x){for(auto i:mp[x])dfs(i),len[x]=max(len[i]+1,len[x]);}
void dfs2(int x,int tp){
    top[x]=tp;
    int sn=0;
    for(auto i:mp[x])if(len[i]>=len[sn])sn=i;
    for(auto i:mp[x])if(i==sn)dfs2(i,tp);else dfs2(i,i);
}
int f[N],sz[N],val[N];
int find(int x){return x==f[x]?x:f[x]=find(f[x]);}
void merge(int x,int y){x=find(x),y=find(y);if(x^y)f[x]=y,sz[y]+=sz[x],val[y]=max(val[y],val[x]);}
int zero[N],ans[N];
vector<int>l[N];
void solve(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)cin>>a[i],in[a[i]]++;
    queue<int>q;
    for(int i=1;i<=n;i++)R[i]=1;
    for(int i=1;i<=n;i++)if(!in[i])q.push(i);
    while(!q.empty()){
        int x=q.front();
        q.pop();R[x]=0;
        if(!--in[a[x]])q.push(a[x]);
    }
    for(int i=1;i<=n;i++)if(R[i])sz[i]=1;else mp[a[i]].push_back(i);
    for(int i=1;i<=n;i++)if(R[i])dfs(i),dfs2(i,i);
    for(int i=1;i<=n;i++)f[i]=i,val[i]=len[i];
    for(int i=1;i<=n;i++)merge(i,a[i]);
    int mx=0;
    for(int i=1;i<=n;i++){
        mx=max(val[find(i)]+sz[find(i)],mx);
        zero[sz[find(i)]]++,zero[sz[find(i)]+val[find(i)]+1]--;
    }
    for(int i=1;i<=mx;i++)zero[i]+=zero[i-1];
    for(int i=1;i<=mx;i++)if(!zero[i])ans[i]=1;
    for(int i=1;i<=n;i++)if(top[i]==i)l[find(i)].push_back(len[i]+(!R[i]));
    for(int i=1;i<=n;i++)sort(l[i].begin(),l[i].end(),greater<>());
    for(int i=1;i<=n;i++)if(!l[i].empty())l[i][0]+=sz[find(i)];
    vector<int>ve;
    for(int i=1;i<=n;i++)for(auto x:l[i])ve.push_back(x);
    sort(ve.begin(),ve.end(),greater<>());
    int nw=ve[0];
    for(int i=1;i<ve.size();i++){
        for(int j=nw+1;j<=nw+ve[i];j++)ans[j]=i;
        nw+=ve[i];
    }
    for(int i=1;i<=n;i++)cout<<ans[i]<<' ';
}

signed main(){
    ios::sync_with_stdio(false);
    int T=1;
   // cin>>T;
    while(T--)solve();
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 19960kb

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: 17904kb

input:

1
1

output:

0 

result:

ok 1 number(s): "0"

Test #3:

score: 0
Accepted
time: 0ms
memory: 17976kb

input:

2
2 2

output:

0 0 

result:

ok 2 number(s): "0 0"

Test #4:

score: 0
Accepted
time: 0ms
memory: 22312kb

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: 19976kb

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: 0ms
memory: 22272kb

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: 0ms
memory: 20020kb

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: 4ms
memory: 22016kb

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: 3ms
memory: 15820kb

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: 22236kb

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: 3ms
memory: 12092kb

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: 3ms
memory: 13832kb

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: 14136kb

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: 5ms
memory: 10804kb

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: 33ms
memory: 27124kb

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: 54ms
memory: 29312kb

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: 98ms
memory: 34492kb

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: 130ms
memory: 42932kb

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: 158ms
memory: 46716kb

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: 71ms
memory: 30380kb

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: 152ms
memory: 44328kb

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: 152ms
memory: 44524kb

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: 73ms
memory: 30060kb

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: 67ms
memory: 30816kb

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: 66ms
memory: 31348kb

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: 70ms
memory: 30480kb

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: 68ms
memory: 31996kb

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: 54ms
memory: 30988kb

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: 68ms
memory: 30072kb

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: 67ms
memory: 30764kb

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: 69ms
memory: 30468kb

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: 65ms
memory: 32488kb

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: 88ms
memory: 42724kb

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: 102ms
memory: 42420kb

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: 108ms
memory: 43404kb

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: 145ms
memory: 47564kb

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