QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#448408#323. Hillsmatere75 117ms24500kbC++14958b2024-06-19 16:24:152024-06-19 16:24:15

Judging History

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

  • [2024-06-19 16:24:15]
  • 评测
  • 测评结果:75
  • 用时:117ms
  • 内存:24500kb
  • [2024-06-19 16:24:15]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,a[5005],dp[5005][5005];
int main(){
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    for(int i=0;i<=n;i++){
        for(int j=1;j<=(n+1)/2;j++){
            dp[i][j]=1e9;
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=(i+1)/2;j++){
            if(i!=1) dp[i][j]=min(dp[i][j],dp[i-2][j-1]+max(0,min(a[i-1],(j-1==0?(int)1e9:a[i-2]-1))-(a[i]-1)));
            else dp[i][j]=0;
            for(int k=0;k<i-2;k++){
                dp[i][j]=min(dp[i][j],dp[k][j-1]+max(0,a[i-1]-(a[i]-1)));
            }
            if(i!=n) dp[i][j]+=max(0,a[i+1]-(a[i]-1));
            // cout<<a[i+1]<<' '<<a[i]-1<<' ';
            // cout<<dp[i][j]<<' ';
        }
        // cout<<endl;
    }
    for(int i=1;i<=(n+1)/2;i++){
        int ans=1e9;
        for(int j=1;j<=n;j++){
            ans=min(ans,dp[j][i]);
        }
        cout<<ans<<' ';
    }
}

詳細信息

Subtask #1:

score: 7
Accepted

Test #1:

score: 7
Accepted
time: 0ms
memory: 3584kb

input:

3
1 2 4

output:

0 2 

result:

ok 2 number(s): "0 2"

Test #2:

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

input:

3
3 2 1

output:

0 2 

result:

ok 2 number(s): "0 2"

Test #3:

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

input:

3
1 2 1

output:

0 2 

result:

ok 2 number(s): "0 2"

Test #4:

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

input:

3
3 3 3

output:

1 1 

result:

ok 2 number(s): "1 1"

Test #5:

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

input:

3
50 80 80

output:

1 31 

result:

ok 2 number(s): "1 31"

Test #6:

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

input:

3
80 80 50

output:

1 31 

result:

ok 2 number(s): "1 31"

Test #7:

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

input:

3
1 100 1

output:

0 100 

result:

ok 2 number(s): "0 100"

Test #8:

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

input:

3
100 1 100

output:

0 0 

result:

ok 2 number(s): "0 0"

Test #9:

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

input:

3
100 100 100

output:

1 1 

result:

ok 2 number(s): "1 1"

Test #10:

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

input:

3
1 1 1

output:

1 1 

result:

ok 2 number(s): "1 1"

Subtask #2:

score: 15
Accepted

Dependency #1:

100%
Accepted

Test #11:

score: 15
Accepted
time: 0ms
memory: 3636kb

input:

1
10

output:

0 

result:

ok 1 number(s): "0"

Test #12:

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

input:

2
1 100

output:

0 

result:

ok 1 number(s): "0"

Test #13:

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

input:

2
2 2

output:

1 

result:

ok 1 number(s): "1"

Test #14:

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

input:

10
2 2 4 4 3 1 1 2 3 2

output:

0 1 2 3 5 

result:

ok 5 number(s): "0 1 2 3 5"

Test #15:

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

input:

10
32 48 20 20 15 2 11 5 10 34

output:

0 0 0 1 31 

result:

ok 5 number(s): "0 0 0 1 31"

Test #16:

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

input:

10
99 62 10 47 53 9 83 33 15 24

output:

0 0 0 0 91 

result:

ok 5 number(s): "0 0 0 0 91"

Test #17:

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

input:

10
1 2 3 4 5 6 7 8 9 10

output:

0 2 4 6 8 

result:

ok 5 number(s): "0 2 4 6 8"

Test #18:

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

input:

10
5 1 6 2 8 3 4 10 9 7

output:

0 0 0 0 3 

result:

ok 5 number(s): "0 0 0 0 3"

Test #19:

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

input:

9
1 100 1 100 1 100 1 100 1

output:

0 0 0 0 400 

result:

ok 5 number(s): "0 0 0 0 400"

Test #20:

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

input:

10
8 9 7 6 3 2 3 2 2 1

output:

0 0 1 3 8 

result:

ok 5 number(s): "0 0 1 3 8"

Test #21:

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

input:

10
1 1 1 3 1 2 4 5 6 10

output:

0 0 1 3 6 

result:

ok 5 number(s): "0 0 1 3 6"

Test #22:

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

input:

10
2 1 3 4 5 6 7 8 9 10

output:

0 0 2 4 6 

result:

ok 5 number(s): "0 0 2 4 6"

Test #23:

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

input:

10
1 2 3 4 9 8 6 7 5 10

output:

0 0 0 2 4 

result:

ok 5 number(s): "0 0 0 2 4"

Test #24:

score: 0
Accepted
time: 1ms
memory: 5628kb

input:

10
6 7 3 9 1 10 5 2 8 4

output:

0 0 0 0 11 

result:

ok 5 number(s): "0 0 0 0 11"

Test #25:

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

input:

10
1 1 1 1 1 1 1 1 1 1

output:

1 2 3 4 5 

result:

ok 5 number(s): "1 2 3 4 5"

Subtask #3:

score: 13
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #26:

score: 13
Accepted
time: 1ms
memory: 5668kb

input:

50
61 58 44 42 53 21 48 34 18 60 51 66 56 50 46 9 5 13 40 40 34 21 32 6 58 67 58 48 41 19 65 31 37 51 21 66 5 41 68 42 22 59 7 67 13 50 30 38 27 25

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 4 9 15 23 33 47 62 90 166 

result:

ok 25 numbers

Test #27:

score: 0
Accepted
time: 1ms
memory: 5788kb

input:

100
27 69 16 53 7 18 40 24 39 16 31 55 65 20 16 22 61 68 62 31 25 7 40 12 69 15 54 30 69 46 44 2 52 69 19 25 3 53 12 24 47 53 66 9 30 57 9 59 68 8 11 31 43 57 7 62 9 12 26 33 5 33 33 28 36 28 39 49 33 24 11 45 26 35 68 41 63 26 28 40 20 58 39 46 61 14 26 45 33 21 61 67 68 27 22 64 49 45 51 35

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 1 4 11 18 25 33 43 55 68 83 103 125 150 176 241 309 406 519 656 

result:

ok 50 numbers

Test #28:

score: 0
Accepted
time: 1ms
memory: 5836kb

input:

100
82 51 81 14 37 17 78 92 64 15 8 86 89 8 87 77 66 10 15 12 100 25 92 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 97 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 59 52 74 31 92 43 42 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 41 21 77 63 17 62 91

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 1 3 7 15 27 39 57 86 133 211 298 385 546 966 

result:

ok 50 numbers

Test #29:

score: 0
Accepted
time: 1ms
memory: 5848kb

input:

100
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

output:

0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 

result:

ok 50 numbers

Test #30:

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

input:

99
1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1

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 4900 

result:

ok 50 numbers

Test #31:

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

input:

100
98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 50 4 80 72 39

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 5 11 27 49 81 115 158 201 249 310 374 458 556 672 816 1193 

result:

ok 50 numbers

Test #32:

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

input:

100
15 8 18 32 16 76 23 52 68 6 67 30 12 86 64 67 1 70 44 12 34 46 3 40 33 47 20 47 23 3 33 4 4 26 5 18 47 56 14 61 28 13 50 52 49 51 36 32 25 12 23 19 17 41 6 28 1 4 6 25 4 38 25 26 27 30 10 4 30 13 21 15 28 8 25 5 6 1 13 18 16 15 3 16 16 8 6 13 4 10 3 7 8 2 6 3 2 1 2 1

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 1 3 5 7 10 15 23 37 60 90 143 199 256 360 468 

result:

ok 50 numbers

Test #33:

score: 0
Accepted
time: 1ms
memory: 4032kb

input:

100
1 2 3 2 4 1 4 8 7 1 4 7 13 1 9 14 11 17 4 15 19 11 3 10 10 6 25 19 21 20 28 8 5 21 35 21 19 28 34 29 18 19 27 16 26 43 34 15 49 34 51 46 36 44 33 42 44 2 12 40 37 22 21 60 6 22 67 55 12 56 27 25 71 66 48 59 20 14 10 71 73 80 4 11 66 64 4 18 70 41 91 15 16 3 33 8 37 48 29 100

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 1 3 6 10 15 22 29 38 53 69 87 113 146 185 231 281 337 542 

result:

ok 50 numbers

Test #34:

score: 0
Accepted
time: 1ms
memory: 5992kb

input:

100
1 2 73 4 5 6 7 8 9 10 11 12 13 50 15 16 17 18 19 20 21 22 23 24 75 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 14 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 3 74 25 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

output:

0 0 0 0 0 0 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 124 

result:

ok 50 numbers

Test #35:

score: 0
Accepted
time: 1ms
memory: 8012kb

input:

100
1 64 23 4 5 2 7 8 9 52 11 12 69 77 16 15 17 62 19 10 21 36 60 24 95 26 86 28 54 30 31 40 97 46 35 37 65 47 39 32 41 42 43 44 45 34 61 27 49 85 51 20 53 73 55 71 57 58 59 3 48 18 91 6 81 66 67 68 13 70 56 72 29 74 75 76 14 78 79 80 22 82 83 84 50 93 87 94 89 90 63 92 38 88 25 96 33 98 99 100

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 2 4 6 8 10 12 14 19 28 38 53 69 99 136 176 234 359 

result:

ok 50 numbers

Test #36:

score: 0
Accepted
time: 1ms
memory: 5828kb

input:

100
85 72 44 25 26 15 43 27 32 71 30 11 99 87 33 61 53 17 94 82 100 80 18 88 5 40 60 37 74 36 13 7 69 81 51 23 54 92 1 4 97 86 41 70 56 91 31 52 65 63 68 78 49 93 9 38 96 48 59 21 66 62 46 34 12 3 84 83 14 57 89 75 8 67 79 19 45 10 20 22 39 55 16 76 2 98 77 35 28 58 24 50 6 73 95 29 90 64 47 42

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 3 9 22 42 66 93 122 153 186 228 271 355 449 572 701 840 1049 

result:

ok 50 numbers

Test #37:

score: 0
Accepted
time: 1ms
memory: 5804kb

input:

100
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

output:

1 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 

result:

ok 50 numbers

Subtask #4:

score: 18
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #38:

score: 18
Accepted
time: 1ms
memory: 5920kb

input:

100
167 58 388 236 436 39 34 122 493 281 386 347 430 384 248 455 291 290 494 3 227 274 409 483 366 158 248 325 191 338 235 204 482 310 437 306 479 227 258 163 446 299 418 123 196 413 132 184 89 38 344 354 372 303 322 302 469 200 88 83 192 174 208 423 398 62 243 183 91 448 323 403 139 45 167 452 288 ...

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 11 42 78 126 195 290 403 516 634 782 998 1216 1499 1844 2222 2878 

result:

ok 50 numbers

Test #39:

score: 0
Accepted
time: 1ms
memory: 4100kb

input:

100
591 417 888 251 792 847 685 3 182 461 102 348 555 956 771 901 712 878 580 631 342 333 285 899 525 725 537 718 929 653 84 788 104 355 624 803 253 853 201 995 536 184 65 205 540 652 549 777 248 405 677 950 431 580 600 846 328 429 134 983 526 103 500 963 400 23 276 704 570 757 410 658 507 620 984 2...

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 1 11 32 195 403 662 923 1193 1466 1743 2171 2735 3503 4393 5928 8340 

result:

ok 50 numbers

Test #40:

score: 0
Accepted
time: 1ms
memory: 5676kb

input:

100
917 477 877 1135 857 351 125 1189 889 1171 721 799 942 147 1252 510 795 1377 511 1462 847 1496 1281 592 387 627 726 692 76 964 848 452 1378 691 1345 359 220 244 758 75 817 409 1245 468 1354 1314 1157 1267 1466 986 320 196 1149 153 1488 288 137 384 475 23 996 187 1401 1207 907 1343 894 379 840 10...

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 36 136 241 406 572 841 1120 1520 2021 2688 3378 4129 5036 6146 7968 11600 

result:

ok 50 numbers

Test #41:

score: 0
Accepted
time: 1ms
memory: 5880kb

input:

100
1777 339 1249 1644 785 810 228 549 1892 464 1067 639 65 1653 981 1858 863 1980 1174 427 1710 345 309 826 31 1898 255 661 951 443 802 195 177 752 979 1842 1689 399 568 1906 129 1571 1263 696 911 810 1877 1932 1389 1128 112 619 184 434 22 1269 386 324 1635 1440 705 300 455 1635 1069 1660 1174 572 ...

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 61 289 551 915 1477 2138 2909 4026 5401 6798 8259 9812 11577 13429 15543 20407 

result:

ok 50 numbers

Test #42:

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

input:

49
1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1

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 24000 

result:

ok 25 numbers

Test #43:

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

input:

49
1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1

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 48000 

result:

ok 25 numbers

Test #44:

score: 0
Accepted
time: 1ms
memory: 6056kb

input:

99
1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1000 1 1...

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 49000 

result:

ok 50 numbers

Test #45:

score: 0
Accepted
time: 1ms
memory: 5832kb

input:

99
1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2000 1 2...

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 98000 

result:

ok 50 numbers

Test #46:

score: 0
Accepted
time: 1ms
memory: 5824kb

input:

99
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

output:

1 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 49 

result:

ok 50 numbers

Subtask #5:

score: 22
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #47:

score: 22
Accepted
time: 1ms
memory: 5864kb

input:

100
20 13 10 38 7 22 40 15 27 32 37 44 42 50 33 46 7 47 43 5 18 29 26 3 32 5 1 29 17 1 1 43 2 38 23 23 49 36 14 18 36 3 49 47 11 19 6 29 14 9 6 46 15 22 31 45 24 5 31 2 24 14 7 15 21 44 8 7 38 50 17 1 29 39 16 35 10 22 19 8 6 42 44 45 25 26 16 34 36 23 17 11 41 15 19 28 44 27 46 8

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 3 9 15 22 29 39 49 61 73 91 119 153 192 238 311 392 487 584 

result:

ok 50 numbers

Test #48:

score: 0
Accepted
time: 1ms
memory: 5988kb

input:

100
637 61 394 666 819 664 274 652 123 152 765 524 375 60 812 832 20 275 85 193 846 815 538 807 15 439 688 882 272 630 132 669 820 646 757 233 470 778 97 450 304 439 240 586 531 59 192 456 540 689 747 507 570 379 375 57 653 512 325 816 640 322 827 48 248 94 838 471 631 151 877 563 482 842 188 276 62...

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 5 34 119 269 425 675 927 1233 1563 1912 2566 3246 4184 5252 7264 11327 

result:

ok 50 numbers

Test #49:

score: 0
Accepted
time: 15ms
memory: 14060kb

input:

500
227 237 59 160 74 214 3 194 190 213 98 48 82 133 156 226 86 18 90 164 15 29 241 170 11 232 246 48 28 112 37 248 81 235 179 250 160 175 17 167 80 245 26 111 228 21 171 91 232 130 44 36 226 123 249 20 158 142 161 76 213 4 198 206 129 114 79 173 103 203 159 44 249 122 118 35 38 185 37 174 170 233 6...

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 250 numbers

Test #50:

score: 0
Accepted
time: 11ms
memory: 13972kb

input:

500
4037 4008 4837 1731 2611 3232 75 535 902 962 92 132 3636 636 3635 1991 689 69 58 3259 524 625 2749 4685 672 385 2376 1801 1420 2784 4788 4347 2108 1751 3022 2887 2925 633 2424 3787 4028 24 4679 711 3400 1246 1795 4260 3404 3157 234 1306 4574 1056 4157 2256 1099 39 3880 1856 1072 4311 3783 800 67...

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 250 numbers

Test #51:

score: 0
Accepted
time: 11ms
memory: 14240kb

input:

500
2614 75610 3434 67855 95109 34629 90900 79195 88076 97604 56431 57133 24851 53213 38949 82206 11882 25788 60103 96204 8194 5743 24777 21784 66930 25291 86723 1222 93139 49924 19281 26784 75173 79128 76756 50292 39336 87046 61872 30769 1508 5103 45548 21358 22433 21372 43701 38692 45296 45207 532...

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 250 numbers

Test #52:

score: 0
Accepted
time: 15ms
memory: 12216kb

input:

500
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 101 ...

output:

0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176...

result:

ok 250 numbers

Test #53:

score: 0
Accepted
time: 15ms
memory: 12316kb

input:

500
412 284 370 109 204 381 27 218 236 374 149 354 111 306 404 216 178 185 293 117 47 151 266 193 387 169 58 74 97 382 327 199 411 25 227 271 357 308 472 129 71 405 457 334 344 122 380 148 318 278 303 5 459 261 338 72 384 89 83 497 400 231 213 158 134 263 225 50 360 53 12 300 320 168 202 150 127 248...

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 250 numbers

Test #54:

score: 0
Accepted
time: 11ms
memory: 13796kb

input:

499
1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000 1 100000...

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 250 numbers

Test #55:

score: 0
Accepted
time: 15ms
memory: 14056kb

input:

500
289 453 316 463 307 325 251 82 193 490 256 165 281 258 428 342 242 235 473 444 297 111 30 238 119 227 46 162 248 349 237 216 205 6 384 81 43 132 371 338 34 305 337 379 264 323 90 234 331 14 268 283 306 406 266 204 349 215 211 162 184 138 60 330 165 241 226 138 294 88 306 258 179 182 408 50 226 1...

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 250 numbers

Test #56:

score: 0
Accepted
time: 15ms
memory: 14284kb

input:

500
1 1 2 4 4 2 2 1 2 4 8 7 8 7 9 12 10 17 17 1 2 12 11 1 4 10 8 5 12 27 23 11 25 2 34 34 32 37 4 7 40 24 2 4 41 22 18 36 7 1 31 4 42 18 14 21 22 10 16 51 5 47 50 15 37 44 54 66 6 30 62 49 23 10 20 19 3 58 75 70 61 11 74 18 25 76 74 36 77 62 4 60 61 47 66 95 52 91 26 34 88 69 67 101 62 3 91 50 84 10...

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 250 numbers

Test #57:

score: 0
Accepted
time: 11ms
memory: 14064kb

input:

500
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 96 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 493 83 84 85 86 87 88 89 90 91 92 93 94 95 58 97 98 99 100 101...

output:

0 0 0 0 0 0 0 0 0 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 1...

result:

ok 250 numbers

Test #58:

score: 0
Accepted
time: 15ms
memory: 14120kb

input:

500
499 2 3 4 5 6 7 8 9 10 11 12 96 14 67 16 246 18 19 20 21 336 23 471 25 26 27 28 29 431 31 32 33 84 13 36 254 38 39 40 41 42 43 44 218 415 47 48 49 50 51 204 53 54 55 56 57 58 59 60 61 62 63 64 65 66 480 68 126 70 396 72 73 74 75 187 77 78 79 80 81 82 83 34 292 86 87 88 89 90 91 92 93 94 22 35 97...

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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102...

result:

ok 250 numbers

Test #59:

score: 0
Accepted
time: 11ms
memory: 12268kb

input:

500
410 446 3 373 315 495 87 226 45 474 11 15 13 436 494 271 230 456 339 32 57 492 113 207 335 26 20 294 265 323 384 182 361 213 34 145 266 185 73 63 180 54 312 276 150 457 305 36 49 50 485 80 120 104 28 82 21 198 247 174 324 405 206 481 65 66 58 77 48 111 71 172 425 125 31 2 68 484 69 397 398 108 7...

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 250 numbers

Test #60:

score: 0
Accepted
time: 12ms
memory: 13936kb

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

1 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 101 102 ...

result:

ok 250 numbers

Subtask #6:

score: 0
Time Limit Exceeded

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #61:

score: 25
Accepted
time: 116ms
memory: 24500kb

input:

1000
325 252 102 474 102 213 436 489 442 260 127 106 479 47 450 391 137 435 388 19 451 177 494 169 476 276 443 421 183 265 495 462 160 339 92 263 184 324 374 44 305 306 150 438 88 250 482 469 252 376 319 39 334 340 182 136 255 495 136 496 312 41 334 479 323 201 302 493 343 116 180 415 428 58 389 144...

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 500 numbers

Test #62:

score: 0
Accepted
time: 117ms
memory: 22432kb

input:

1000
1609 7422 5209 1618 7129 7700 893 6647 8231 3314 9844 1347 6789 2711 3968 7416 5864 9190 9564 8874 7357 2087 530 8754 7935 6772 3475 8206 2898 2717 9252 8686 6604 5188 7451 9977 9366 7618 6294 6454 3919 3232 8164 8403 8617 2191 5257 626 8554 1952 1727 4759 205 9453 3312 9387 4798 7774 7005 8892...

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 500 numbers

Test #63:

score: -25
Time Limit Exceeded

input:

5000
335 370 93 303 246 51 165 259 316 29 272 282 43 25 475 268 124 326 10 161 268 309 351 349 8 130 16 313 381 433 133 293 176 154 84 213 323 315 244 180 18 368 177 184 452 122 233 128 151 337 409 419 487 500 62 440 484 333 489 245 331 62 272 218 22 481 234 89 93 188 123 312 57 278 129 152 496 437 ...

output:


result: