QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#46898#2283. Decelerating JumpnjianWA 168ms74536kbC++553b2022-09-02 15:22:082022-09-02 15:22:10

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-09-02 15:22:10]
  • 评测
  • 测评结果:WA
  • 用时:168ms
  • 内存:74536kb
  • [2022-09-02 15:22:08]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[3010];
long long f[3010][3010],p[3010];
int n;
int main ()
{
    cin>>n;
    for(int i=1;i<=n;i++)cin>>a[i],p[i]=-0x3f3f3f3f;
    memset(f,-0x3f,sizeof(f));
    p[1]=a[1];
    for(int s=n-1;s>=1;s--)
    {
        for(int i=1;i<=n;i++)
        {
            if(i-s>=1)f[i][s]=max(f[i][s],p[i-s]+a[i]);
            p[i]=max(p[i],f[i][s]);
        }
    }
    ll ans=-0x3f3f3f3f;
    for(int i=1;i<=n;i++)ans=max(ans,f[n][i]);
    cout<<ans;
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 16ms
memory: 74496kb

input:

1000
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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

2

result:

ok single line: '2'

Test #2:

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

input:

1000
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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

3

result:

ok single line: '3'

Test #3:

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

input:

1000
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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

7

result:

ok single line: '7'

Test #4:

score: 0
Accepted
time: 16ms
memory: 74384kb

input:

1000
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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

12

result:

ok single line: '12'

Test #5:

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

input:

1000
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 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...

output:

27

result:

ok single line: '27'

Test #6:

score: 0
Accepted
time: 21ms
memory: 74472kb

input:

1000
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 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0...

output:

35

result:

ok single line: '35'

Test #7:

score: 0
Accepted
time: 25ms
memory: 74352kb

input:

2
0 0

output:

0

result:

ok single line: '0'

Test #8:

score: 0
Accepted
time: 4ms
memory: 74376kb

input:

2
-1 -9

output:

-10

result:

ok single line: '-10'

Test #9:

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

input:

10
-1 0 1 0 0 0 1 1 1 -1

output:

2

result:

ok single line: '2'

Test #10:

score: 0
Accepted
time: 17ms
memory: 74260kb

input:

20
-2 -2 -1 -1 -2 1 0 1 2 3 -1 2 1 3 2 3 -1 -2 -1 3

output:

14

result:

ok single line: '14'

Test #11:

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

input:

10
3 10 -2 -9 4 -7 5 -7 -4 -5

output:

3

result:

ok single line: '3'

Test #12:

score: 0
Accepted
time: 21ms
memory: 74448kb

input:

50
-8 -3 -9 -9 -4 -8 7 -4 -10 -4 8 -9 -6 1 7 2 0 -3 7 3 -7 -9 -9 -9 6 -7 -2 -10 2 8 -10 -5 6 -4 -3 7 -8 -6 9 5 3 -4 9 1 10 8 0 -1 2 6

output:

82

result:

ok single line: '82'

Test #13:

score: 0
Accepted
time: 8ms
memory: 74396kb

input:

100
-64 65 -52 -25 39 -83 23 30 35 51 22 73 20 -18 -29 90 44 28 -34 -88 -79 -49 57 -63 86 -6 -92 28 44 41 73 8 -83 18 -25 40 29 87 50 22 -5 96 99 -74 60 -18 92 21 -65 -78 -17 -25 -8 49 69 -78 -82 92 83 -14 33 90 57 19 65 -50 -19 -77 74 -11 54 21 72 -55 -66 -43 -44 94 -27 46 -74 64 -8 -45 -78 14 -6 -...

output:

834

result:

ok single line: '834'

Test #14:

score: 0
Accepted
time: 20ms
memory: 74320kb

input:

200
-592 -939 223 74 -372 736 38 -455 735 -998 422 331 -740 142 38 -561 70 765 764 -839 -882 373 -174 938 -679 -33 596 98 -732 142 89 981 -743 -284 790 -289 -908 -830 -666 122 314 299 -192 545 119 -842 -113 934 -580 -72 60 -349 659 -562 885 835 629 -888 366 -245 -260 25 -193 683 -734 979 209 219 922...

output:

14459

result:

ok single line: '14459'

Test #15:

score: 0
Accepted
time: 8ms
memory: 74376kb

input:

300
-1282 5441 4865 -1420 -8118 6740 -2338 8435 -1095 3910 -9689 5258 -6414 8818 -1922 4168 6575 3345 -7739 -1709 -2456 -129 -9151 -4377 -9100 -1500 7944 9614 9380 -1510 4084 -3084 -3499 6851 -7316 7517 -172 1923 6690 -9334 639 -7411 55 -6105 4174 -7667 -9254 3848 -7194 9846 4137 -6914 -1023 6028 91...

output:

222431

result:

ok single line: '222431'

Test #16:

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

input:

500
-9312 3629 8352 -7728 5135 81 -959 251 -9992 -4873 6875 1153 2051 -559 7920 2726 9524 -2830 -4068 9650 -9989 3902 -4634 -4342 -6615 3225 -6581 -2189 -7899 8427 -8501 5663 -7532 -3316 -31 7085 912 7165 5484 5435 1439 9351 9059 1071 -7166 -7371 -6786 -2978 -1303 -2821 -90 827 -2934 -4066 6413 -265...

output:

334460

result:

ok single line: '334460'

Test #17:

score: 0
Accepted
time: 151ms
memory: 74416kb

input:

2990
-970733755 373162926 610706002 746420415 -24022769 446900035 80395723 -518380142 727642894 -802578839 -299221072 790023549 812359052 558846138 816832324 987432334 802786331 -460777465 821945862 -928082137 -166432503 927724630 -663110602 304682374 -219146966 -229896662 -389891025 508234675 55873...

output:

92279083496

result:

ok single line: '92279083496'

Test #18:

score: 0
Accepted
time: 151ms
memory: 74436kb

input:

2999
-500871756 570771509 -197276377 -847066915 -566097239 289678269 -16423398 -512745365 947375427 359581421 -220058506 -704742619 714443677 606538047 -443765043 798590851 -808020275 306066404 -561778738 -713774588 -970747408 610730044 -364520383 -10370313 961430924 -631087201 732038986 -358099605 ...

output:

90429110757

result:

ok single line: '90429110757'

Test #19:

score: 0
Accepted
time: 149ms
memory: 74520kb

input:

3000
213094805 -108017794 -238229780 -650750598 -802944905 -111172376 852414678 741760591 248883131 434994214 748201077 366707297 448044854 164117798 694175620 -564280780 648921182 744291754 804391782 -908186065 97203703 245670766 -854349299 276810605 399620159 -354108676 359471020 -29381171 -498575...

output:

120899458899

result:

ok single line: '120899458899'

Test #20:

score: 0
Accepted
time: 168ms
memory: 74484kb

input:

3000
168486475 198082842 421090264 611883877 457983657 429777509 609535360 22402929 991762563 218301029 963087286 466902149 242414996 424701884 150811671 280262299 61076431 522078901 74645450 442148993 654915219 166120260 161340489 536941915 829172104 370146519 622605598 472117607 758933337 49230841...

output:

1512103572038

result:

ok single line: '1512103572038'

Test #21:

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

input:

13
2 1 5 14 5 10 9 14 20 11 11 14 4

output:

120

result:

ok single line: '120'

Test #22:

score: -100
Wrong Answer
time: 157ms
memory: 74424kb

input:

3000
-590557474 -754423105 -488261225 -456508664 -431557527 -260691112 -497223526 -364306883 -392409017 -97595563 -130511640 -356980659 -81995018 -607766326 -887472704 -3612720 -584128861 -386360742 -732463430 -318210763 -949016176 -156279605 -505067268 -289557075 -385212833 -175330337 -185270199 -2...

output:

-1061109567

result:

wrong answer 1st lines differ - expected: '-1489436588', found: '-1061109567'