QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#784019#1132. Financial Report_8_8_#48 63ms5764kbC++17825b2024-11-26 12:43:232024-11-26 12:43:25

Judging History

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

  • [2024-11-26 12:43:25]
  • 评测
  • 测评结果:48
  • 用时:63ms
  • 内存:5764kb
  • [2024-11-26 12:43:23]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = (int)1e6 + 12;

int n, d, a[N], dp[N];
void test() {
    cin >> n >> d;
    for(int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    int res = 1;
    for(int i = 1; i <= n; i++) {
        dp[i] = max(dp[i], 1);
        int lst = i;
        for(int j = i + 1; j  <= n; j++) {
            if(j - lst > d) break;
            if(a[j] <= a[i]) {
                lst = j;
            }
            if(a[j] > a[i]) {
                dp[j] = max(dp[j], dp[i] + 1);
            }
        }
        res = max(res, dp[i]);
    }

    cout << res << '\n';
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int t = 1;
    //cin >> t;

    while(t--)
        test();

    return 0;
}

详细

Subtask #1:

score: 14
Accepted

Test #1:

score: 14
Accepted
time: 1ms
memory: 5560kb

input:

1 1
314159265

output:

1

result:

ok single line: '1'

Test #2:

score: 14
Accepted
time: 1ms
memory: 5564kb

input:

1 1
0

output:

1

result:

ok single line: '1'

Test #3:

score: 14
Accepted
time: 1ms
memory: 5752kb

input:

1 1
1000000000

output:

1

result:

ok single line: '1'

Test #4:

score: 14
Accepted
time: 1ms
memory: 5692kb

input:

2 1
299792458 299792458

output:

1

result:

ok single line: '1'

Test #5:

score: 14
Accepted
time: 1ms
memory: 5556kb

input:

2 1
141421356 173205080

output:

2

result:

ok single line: '2'

Test #6:

score: 14
Accepted
time: 1ms
memory: 5684kb

input:

2 1
244948974 223606797

output:

1

result:

ok single line: '1'

Test #7:

score: 14
Accepted
time: 1ms
memory: 5600kb

input:

2 2
299792458 299792458

output:

1

result:

ok single line: '1'

Test #8:

score: 14
Accepted
time: 1ms
memory: 5688kb

input:

2 2
141421356 173205080

output:

2

result:

ok single line: '2'

Test #9:

score: 14
Accepted
time: 1ms
memory: 5688kb

input:

2 2
244948974 223606797

output:

1

result:

ok single line: '1'

Test #10:

score: 14
Accepted
time: 1ms
memory: 5604kb

input:

3 1
500000000 1000000000 0

output:

2

result:

ok single line: '2'

Test #11:

score: 14
Accepted
time: 1ms
memory: 5604kb

input:

3 2
500000000 1000000000 0

output:

2

result:

ok single line: '2'

Test #12:

score: 14
Accepted
time: 1ms
memory: 5596kb

input:

4 1
0 1000000000 200000000 500000000

output:

2

result:

ok single line: '2'

Test #13:

score: 14
Accepted
time: 1ms
memory: 5564kb

input:

4 2
0 1000000000 200000000 500000000

output:

3

result:

ok single line: '3'

Test #14:

score: 14
Accepted
time: 1ms
memory: 5680kb

input:

5 2
111111111 888888888 555555555 222222222 444444444

output:

2

result:

ok single line: '2'

Test #15:

score: 14
Accepted
time: 1ms
memory: 5684kb

input:

19 1
876813783 876813783 294665595 1000000000 515198511 876813783 876813783 294665595 403855901 439947219 439947219 403855901 581007064 294665595 1000000000 581007064 294665595 865289906 865289906

output:

5

result:

ok single line: '5'

Test #16:

score: 14
Accepted
time: 1ms
memory: 5576kb

input:

17 2
49121102 449215299 18829293 449463830 765492419 440501697 233785699 50699732 569054461 105188844 983737936 877900994 0 44809615 361020433 74987201 725464354

output:

5

result:

ok single line: '5'

Test #17:

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

input:

15 3
807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796

output:

1

result:

ok single line: '1'

Test #18:

score: 14
Accepted
time: 0ms
memory: 5600kb

input:

20 7
733581184 733581184 0 205928229 0 733581184 1000000000 733581184 0 815970650 975939523 0 815970650 975939523 0 205928229 0 733581184 205928229 815970650

output:

5

result:

ok single line: '5'

Test #19:

score: 14
Accepted
time: 1ms
memory: 5692kb

input:

18 12
1000000000 358612551 1000000000 358612551 358612551 358612551 358612551 1000000000 1000000000 1000000000 358612551 358612551 1000000000 1000000000 358612551 1000000000 1000000000 358612551

output:

2

result:

ok single line: '2'

Test #20:

score: 14
Accepted
time: 0ms
memory: 5672kb

input:

20 20
802421546 601860856 909073419 815745406 913824895 924761528 954389636 774128549 427176220 23722581 439396497 59191904 121848351 774320268 817458024 565828491 890339952 82761751 717137276 524535907

output:

6

result:

ok single line: '6'

Test #21:

score: 14
Accepted
time: 1ms
memory: 5624kb

input:

20 2
220907318 325117564 759996279 361226977 713619929 530965981 367577457 488411054 555070688 620059582 541892208 949650763 645304844 727718360 709566813 803811825 110264462 960815323 875849635 450666865

output:

10

result:

ok single line: '10'

Test #22:

score: 14
Accepted
time: 1ms
memory: 5752kb

input:

20 4
920699809 20405458 430167187 323905322 321816206 337791282 869436958 505338540 45509543 532042224 672842133 816481120 854290279 948611594 979068279 996148973 674793874 347773693 320013346 759492294

output:

11

result:

ok single line: '11'

Test #23:

score: 14
Accepted
time: 0ms
memory: 5664kb

input:

20 1
10000000 60000000 110000000 160000000 210000000 260000000 310000000 360000000 410000000 460000000 510000000 560000000 610000000 660000000 710000000 760000000 810000000 860000000 910000000 960000000

output:

20

result:

ok single line: '20'

Test #24:

score: 14
Accepted
time: 1ms
memory: 5756kb

input:

20 1
970000000 920000000 870000000 820000000 770000000 720000000 670000000 620000000 570000000 520000000 470000000 420000000 370000000 320000000 270000000 220000000 170000000 120000000 70000000 20000000

output:

1

result:

ok single line: '1'

Test #25:

score: 14
Accepted
time: 1ms
memory: 5604kb

input:

16 5
68514423 410103741 591567982 865691960 982387008 223996512 306149309 324123848 352045607 927590130 238419389 252822214 452213108 539870292 860882612 965882206

output:

9

result:

ok single line: '9'

Test #26:

score: 14
Accepted
time: 1ms
memory: 5684kb

input:

17 4
22790108 220864673 248053769 404589265 637574960 166412775 260226295 262479043 286448651 300001992 734205739 58675918 181211505 263369364 299892200 509157732 867133240

output:

9

result:

ok single line: '9'

Subtask #2:

score: 14
Accepted

Dependency #1:

100%
Accepted

Test #27:

score: 14
Accepted
time: 1ms
memory: 5608kb

input:

400 1
697625071 338955244 701273756 765293932 12805194 46984119 775140965 390552579 875281333 950702147 361444232 680144638 917418512 747923326 543035419 899203308 659270340 218742714 484689980 866434940 270117732 538163289 665365203 226080481 734351408 300250974 824534838 56953777 250622631 4998775...

output:

15

result:

ok single line: '15'

Test #28:

score: 14
Accepted
time: 1ms
memory: 5604kb

input:

397 4
467705846 767740944 895438469 533795958 693293401 869030737 691890948 522874750 670064696 815950426 83220749 368503752 5886628 670367518 609376726 194811413 318102838 766625872 758649856 845072193 606306969 52285365 72714393 155785860 666438261 387383555 79107247 370372410 228320080 342363590 ...

output:

26

result:

ok single line: '26'

Test #29:

score: 14
Accepted
time: 1ms
memory: 5612kb

input:

375 7
419990450 226023065 518565144 389170913 6829200 997083989 55187689 570620839 206928279 344779139 772964274 597404515 211682354 376663678 431873380 459063765 949200561 855646588 968869829 258337829 459063765 389170913 877761657 893177314 949200561 914249958 155847450 195707470 313542363 6024787...

output:

30

result:

ok single line: '30'

Test #30:

score: 14
Accepted
time: 0ms
memory: 5688kb

input:

382 14
297641955 579261299 693365773 503834660 625185678 930401348 231126864 588719210 115995879 871663635 258093515 21599253 717037833 133866136 302501944 794309456 331324463 33313393 169169419 178114058 513684028 420634528 381201674 795038522 120614458 785418360 709760430 156406189 724382191 13433...

output:

33

result:

ok single line: '33'

Test #31:

score: 14
Accepted
time: 1ms
memory: 5728kb

input:

398 68
87296112 87296112 0 0 87296112 87296112 87296112 0 0 0 87296112 0 87296112 87296112 0 87296112 87296112 0 0 87296112 0 0 0 87296112 0 0 0 0 87296112 87296112 87296112 87296112 0 87296112 0 0 87296112 0 87296112 87296112 0 0 87296112 87296112 87296112 87296112 0 87296112 0 0 0 87296112 0 0 872...

output:

2

result:

ok single line: '2'

Test #32:

score: 14
Accepted
time: 1ms
memory: 5664kb

input:

400 400
313643918 524837714 454497606 202185266 437460102 990219224 516405597 233454847 415501995 729752658 126493633 349361696 745579115 265649159 131329130 891526222 924054909 942306716 304196292 299533653 551317273 576482438 187264127 512575413 296382331 880052159 639485797 822109205 525502039 92...

output:

37

result:

ok single line: '37'

Test #33:

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

input:

400 2
572992061 931760159 538911610 891579979 861642215 54327796 130767579 217152621 806772462 958998532 482498465 110236290 534509333 90384831 344203521 398544881 920189563 166667845 630221338 89304326 788119936 598881289 996249896 499062241 215002930 456126547 938742792 76742232 377279685 91368408...

output:

178

result:

ok single line: '178'

Test #34:

score: 14
Accepted
time: 1ms
memory: 5684kb

input:

400 6
32850957 474568476 227393309 630723698 167871732 354713013 389685651 299988790 967355970 965004350 715503841 467286086 498715418 471251794 460548737 517020574 748737219 244292652 90334581 755243526 495303468 333725872 857155431 190563758 754274079 750605544 808305303 937057193 418690406 968735...

output:

121

result:

ok single line: '121'

Test #35:

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

input:

400 8
79961857 576026118 16651375 879359072 193504323 569824876 634814541 871160695 511489526 173357034 97742195 84534766 954895737 964675532 544456288 68397614 125750383 789974450 428100633 274455301 851478710 380463960 686092199 325634643 617240385 320281317 103433469 850604969 887147210 652637705...

output:

81

result:

ok single line: '81'

Test #36:

score: 14
Accepted
time: 1ms
memory: 5680kb

input:

400 36
672509835 968244063 457843819 533220194 8063350 409206579 168978949 466574816 899087033 285953558 728053213 894434695 257073896 414052552 552097198 102236348 2414491 911600232 776967305 747095786 360363242 22141552 578403058 819697857 5849647 373314810 825058085 343112586 8395386 956557769 36...

output:

60

result:

ok single line: '60'

Test #37:

score: 14
Accepted
time: 1ms
memory: 5692kb

input:

391 5
15756643 28559248 17487648 28685063 41063081 16751972 11095509 23603424 24823382 7038374 41161660 18075846 20970076 12807907 26381790 18306742 40221542 46262836 44038516 35183563 35171512 39407822 32878890 52404899 22696539 57205882 38655319 49528464 49655633 29146099 43241199 55320605 4496007...

output:

130

result:

ok single line: '130'

Test #38:

score: 14
Accepted
time: 1ms
memory: 5560kb

input:

389 8
132932626 51483275 53053136 39473371 114679338 82014215 117871074 4578588 38886546 184183396 96824433 110271307 8869552 87165913 202416955 13377084 92703547 98501358 81507515 9116699 115752025 262825071 65150741 59092990 107677249 140705122 30582132 80644036 190412737 104863688 97316270 785163...

output:

72

result:

ok single line: '72'

Test #39:

score: 14
Accepted
time: 1ms
memory: 5696kb

input:

400 17
151095706 190975190 436755026 544554326 627550531 662975688 731354911 839795955 127584834 135440339 215656518 357864438 746751018 786782791 810927606 811210605 1237342 66583570 331360859 368102996 500057934 742456547 813503798 981487152 17041396 274598434 683481223 698445202 704291741 8901336...

output:

39

result:

ok single line: '39'

Test #40:

score: 14
Accepted
time: 0ms
memory: 5660kb

input:

400 26
919068014 915312027 877597208 861346503 861071054 802433166 769027385 749253388 747182416 736938102 716626759 709839569 693282274 676841819 642280286 621501313 616134084 612553098 477369992 409815828 362120372 324994216 312898769 278866725 267550910 230290918 198714023 159535083 145963617 144...

output:

12

result:

ok single line: '12'

Subtask #3:

score: 20
Accepted

Dependency #2:

100%
Accepted

Test #41:

score: 20
Accepted
time: 1ms
memory: 5580kb

input:

7000 1
894882663 687753860 274846006 785270210 3034342 194264610 291176506 356300576 120019831 305340082 101303261 801498371 440274687 761247865 857100563 398852968 963685664 414803100 659457692 531909044 617088521 745956160 841866618 606356828 951489050 862821239 183071512 867632063 206346442 96390...

output:

16

result:

ok single line: '16'

Test #42:

score: 20
Accepted
time: 2ms
memory: 5684kb

input:

6891 2
632527524 380090567 457881486 582901705 708262391 626697081 867421844 784051327 543701519 188202428 101402683 828650744 340629967 952806253 467068793 47484909 242849333 236919334 881161983 645230044 547203841 720367375 757188731 219094902 333520200 837043846 977837 372876193 773042618 6064653...

output:

61

result:

ok single line: '61'

Test #43:

score: 20
Accepted
time: 6ms
memory: 5636kb

input:

6947 5
0 606521094 606521094 71862996 833581144 71862996 606521094 0 71862996 0 0 71862996 606521094 606521094 71862996 606521094 0 71862996 833581144 0 606521094 71862996 606521094 833581144 71862996 606521094 0 71862996 606521094 606521094 606521094 833581144 606521094 71862996 0 71862996 71862996...

output:

4

result:

ok single line: '4'

Test #44:

score: 20
Accepted
time: 36ms
memory: 5628kb

input:

6082 17
653825844 95003719 232511819 282711510 413302615 295686021 729879996 390205014 704773361 41234297 927053886 125874319 684535027 787769423 447975483 725930843 29298948 192207929 861267968 748889787 265752982 748201966 993282254 185270081 794213726 137379742 968170538 583426317 278561844 67425...

output:

130

result:

ok single line: '130'

Test #45:

score: 20
Accepted
time: 57ms
memory: 5636kb

input:

6598 239
119845597 214713881 621450789 155237032 362833540 427146986 911580330 429805492 287020533 803270157 330531943 869240942 378374360 701999344 374194594 137325913 211388065 240199215 212418273 772905399 215550283 197154671 998482968 740996765 248290110 737918383 520172181 420153620 987228969 6...

output:

155

result:

ok single line: '155'

Test #46:

score: 20
Accepted
time: 63ms
memory: 5648kb

input:

7000 7000
878120849 707107263 545848166 957389012 415182409 616010725 489144426 366437303 96187160 829743578 588284055 89692724 148894245 722236778 454753205 869731774 227942653 969689769 882913893 344439431 959034671 911507934 610544102 228398651 580991988 147548958 877099070 940338556 942651766 10...

output:

155

result:

ok single line: '155'

Test #47:

score: 20
Accepted
time: 3ms
memory: 5700kb

input:

6700 3
278590013 12588909 958880531 247155375 380042332 373025120 894279121 25453788 191885364 700319075 357247233 726517884 592025671 927795034 790414908 512393766 121146395 101594668 850993017 20094136 153277941 426471417 914571733 257378911 756667582 63233739 335465243 790162055 158804185 2781735...

output:

3834

result:

ok single line: '3834'

Test #48:

score: 20
Accepted
time: 15ms
memory: 5716kb

input:

6800 7
704128693 234065385 172120190 718808373 620392552 972063868 84418881 649704234 488070112 12224911 827692119 840223369 767923697 84882056 346017250 597306318 875973576 896790035 367946936 795401539 924624576 164190602 612848948 246557796 695878609 668410588 894320416 56926549 529468578 9389639...

output:

1236

result:

ok single line: '1236'

Test #49:

score: 20
Accepted
time: 25ms
memory: 5632kb

input:

6900 35
450072458 945833108 213437623 912112388 985894141 186455424 359328402 476293022 625433483 723805554 378833024 917292930 464791730 128577839 175175834 180497438 579466933 911153055 201534372 169949982 299401590 316688282 432415476 119133990 520604741 575354077 794734809 709724209 678982039 52...

output:

276

result:

ok single line: '276'

Test #50:

score: 20
Accepted
time: 28ms
memory: 5652kb

input:

7000 68
532612757 527223309 335822658 593825853 417795604 2264523 268671227 666318862 460682554 922630283 15650021 724245039 952429216 462944193 190215750 428930202 430841267 480841752 493844310 168757618 280423325 549533863 876080714 501508186 792030638 552016853 645867171 479201045 792233395 98555...

output:

228

result:

ok single line: '228'

Test #51:

score: 20
Accepted
time: 1ms
memory: 5624kb

input:

7000 1
12371016 8610235 12925395 3165091 6966911 11327287 5049186 17141933 4501546 13209104 13110873 8144503 1588461 23954099 6678958 3618181 12158459 11941082 9211122 1971044 7133482 15319252 9892103 12928703 6904543 8704990 6713320 3185737 16950682 20043309 14338545 7075289 12980599 26058526 56502...

output:

217

result:

ok single line: '217'

Test #52:

score: 20
Accepted
time: 1ms
memory: 5716kb

input:

7000 2
72214509 129054035 57936632 37588781 21847484 19982056 52674224 94225753 247073840 36658623 5392933 129435716 289586017 135719622 42779872 10181692 104309873 334712429 18690144 65622212 87488882 68599904 109598208 92149674 55199635 106726324 77849583 65482911 23438019 4858238 168091315 310376...

output:

111

result:

ok single line: '111'

Test #53:

score: 20
Accepted
time: 1ms
memory: 5652kb

input:

7000 7
110338 479413 254382 729010 755017 561788 1378622 968942 1222542 1531947 1386814 2133421 1207310 2168019 2031279 2031846 1997685 2133510 2488581 2088526 2906032 3184421 3125430 3223973 3159361 4138311 3537975 3385416 3659566 3945523 4598674 4607925 4129777 4090764 4813146 4990584 4964286 5362...

output:

4043

result:

ok single line: '4043'

Test #54:

score: 20
Accepted
time: 3ms
memory: 5688kb

input:

7000 58
2900991 1055588 2399597 6142594 6181086 1808857 826500 8537340 2409664 7200602 1689042 2272979 2940795 102354 10332963 11754508 1461010 7247260 10277442 13361648 3877144 10992372 9570062 7670553 9121416 4305570 6820379 5620512 14691324 9550730 5468515 3818933 11979975 8111300 3109632 9400414...

output:

1121

result:

ok single line: '1121'

Test #55:

score: 20
Accepted
time: 53ms
memory: 5720kb

input:

7000 316
294291327 278108753 144036115 69606222 199317479 1409237 24677629 172814612 286057385 131747009 212302034 415887769 1523474 203796971 121516354 34438481 34892874 279537657 38843996 346920348 249062012 73577270 163223033 93533196 10276911 119511490 465241848 207696181 522797448 60403937 2476...

output:

220

result:

ok single line: '220'

Test #56:

score: 20
Accepted
time: 23ms
memory: 5696kb

input:

6953 307
2358163 54923986 78689040 184011021 253580116 289436715 349695004 377127530 413972065 419316830 430120611 519220523 548185667 624001566 656828754 746687724 773106933 778472491 814222959 832172554 838088251 868264391 889869687 900918350 927954019 997477453 23576089 59505438 59789546 15618395...

output:

176

result:

ok single line: '176'

Test #57:

score: 20
Accepted
time: 29ms
memory: 5720kb

input:

6986 59
30267579 114526919 245210016 295643487 361933372 447212121 472771088 524922966 611744621 636556557 658856037 666671065 699978432 730424683 750060133 892523422 930965374 987105849 993292938 48947611 153884610 162604789 176777279 191444673 237985496 403726785 407914282 415296823 415641800 4239...

output:

176

result:

ok single line: '176'

Test #58:

score: 20
Accepted
time: 15ms
memory: 5764kb

input:

7000 6997
415885 999929409 999896770 999400299 999163707 998994317 998963012 998668376 998646012 998458918 998351634 998085441 997755439 997504500 997434792 997192000 997090131 997086503 997047292 996874409 996775206 996747081 996729268 996716844 996599233 996338116 996020139 995913390 995525081 995...

output:

2

result:

ok single line: '2'

Test #59:

score: 20
Accepted
time: 15ms
memory: 5708kb

input:

7000 6998
81326 999994313 999939097 999888570 999842220 999636662 999566806 999480316 999048212 998947874 998251994 998099804 997551809 997469989 997426516 997315246 996850633 996665454 996489994 996396157 996170003 995829721 995619805 995573643 995417797 995394295 995301375 995248858 995166331 9949...

output:

3

result:

ok single line: '3'

Test #60:

score: 20
Accepted
time: 18ms
memory: 5716kb

input:

6810 295
163903 968076529 965947171 961243931 956895936 953825367 951583637 949848288 946878692 943337079 940835736 937314270 934299805 932552285 928858986 925759101 921861430 918345907 916386415 913461413 910477403 907364272 904849286 902042203 898062809 894579670 892279266 887649802 884946400 8813...

output:

24

result:

ok single line: '24'

Test #61:

score: 20
Accepted
time: 15ms
memory: 5720kb

input:

6810 296
364363 970268896 967154068 963380385 959868528 956963449 953758508 949841769 945709162 941659488 938241908 935471564 931953505 928521770 924058667 921097263 917855847 914813939 911311542 907656476 905352658 901171765 898895367 896078927 893785158 889172282 885948979 882092490 877449012 8731...

output:

25

result:

ok single line: '25'

Subtask #4:

score: 0
Time Limit Exceeded

Test #62:

score: 0
Time Limit Exceeded

input:

300000 1
285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 2...

output:


result:


Subtask #5:

score: 0
Time Limit Exceeded

Test #76:

score: 0
Time Limit Exceeded

input:

300000 300000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 ...

output:


result:


Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%