QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#370369#4089. 회의실seojinhyeong9917 16ms4212kbC++171.6kb2024-03-29 02:40:322024-03-29 02:40:34

Judging History

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

  • [2024-03-29 02:40:34]
  • 评测
  • 测评结果:17
  • 用时:16ms
  • 内存:4212kb
  • [2024-03-29 02:40:32]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
typedef pair<int, int> pi;
typedef long long ll;
long long int min_charge(int K, vector<int> S, vector<int>E, vector<int>W) {
    int n, k;
    n = S.size();
    k = K;
    vector<array<ll, 3>>v(n);
    for (int i = 0; i < n; i++) {
        v[i] = { S[i],E[i],W[i] };
    }
    sort(v.begin(), v.end());
    vector<priority_queue<ll, vector<ll>, greater<ll>>>pq(n);
    vector<ll>d(n);
    ll sum = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (v[i][1] >= v[j][1]) {
                pq[i].push(v[j][2]);
                d[i] += v[j][2];
                if (pq[i].size() > k) {
                    d[i] -= pq[i].top();
                    pq[i].pop();
                }
            }
        }
    }
    for (int i = 0; i < n; i++) {
        auto& cur = v[i];
        sum += cur[2];
        ll mx = d[i];
        for (int j = i; j >= 0; j--) {
            if (v[j][1] < cur[0]) break;
            if (v[j][1] > v[i][1]||j!=i) continue;
            ll base = 0;
            for (int nj = 0; nj < j; nj++) {
                if (v[nj][1] < v[j][0]) base = max(base, d[nj]);
            }
            pq[i].push(v[j][2]);
            d[i] += v[j][2];
            if (pq[i].size() > k) {
                d[i] -= pq[i].top();
                pq[i].pop();
            }
            mx = max(mx, d[i] + base);
        }
        d[i] = mx;
        //cout<<i<<" : "<<mx<<"\n";
    }
    ll ans = 0;
    for (auto i : d) ans = max(ans, i);
    return sum - ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 10
Accepted
time: 1ms
memory: 3672kb

input:

5 1
2 6 5
4 6 2
8 8 5
1 3 4
6 8 7

output:

gxr40gvcqh-MEETING-rga0zuq58u
12

result:

ok 2 lines

Test #2:

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

input:

1 1
260947663 693934985 986106006

output:

gxr40gvcqh-MEETING-rga0zuq58u
0

result:

ok 2 lines

Test #3:

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

input:

14 1
623816097 623816097 68434400
623816097 623816097 725559682
623816097 623816097 678758318
623816097 623816097 368499632
623816097 623816097 495567409
623816097 623816097 236794280
623816097 623816097 779885584
623816097 623816097 879061467
623816097 623816097 537101862
623816097 623816097 465992...

output:

gxr40gvcqh-MEETING-rga0zuq58u
5864098008

result:

ok 2 lines

Test #4:

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

input:

14 1
474097486 930251201 788591065
2688701 471061191 845510022
2688701 203686122 275418775
203686122 601081080 31535815
474097486 474097486 228315825
161901890 474097486 85031827
203686122 601081080 337856340
471061191 601081080 604276423
161332531 471061191 357335089
262608550 474097486 82141704
26...

output:

gxr40gvcqh-MEETING-rga0zuq58u
3746923312

result:

ok 2 lines

Test #5:

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

input:

14 1
494186620 531108277 961242307
620452125 623567580 364091773
23975216 357841107 512604788
59502148 793676488 729004547
293504000 748896401 598615542
398747973 967374174 642479347
31019655 476793418 584205112
376644841 543109385 320093318
874414082 884558783 925710684
327711462 354634260 92343656...

output:

gxr40gvcqh-MEETING-rga0zuq58u
4831774383

result:

ok 2 lines

Test #6:

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

input:

14 1
75174224 119784548 640235191
56979455 517584689 581193450
497947002 769774984 246540162
466114327 730965896 881923182
172607550 997207262 13580762
5487679 223191218 16441814
514455732 804556479 420528181
791494 889547290 132020407
57805993 72102775 395810666
24721884 570779130 309337420
2039556...

output:

gxr40gvcqh-MEETING-rga0zuq58u
4024725163

result:

ok 2 lines

Test #7:

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

input:

15 1
58620784 58620784 849177067
58620784 58620784 399820121
58620784 58620784 321591112
58620784 58620784 590469955
58620784 58620784 778815132
58620784 58620784 110225002
58620784 58620784 72173525
58620784 58620784 248944784
58620784 58620784 264448423
58620784 58620784 179086970
58620784 5862078...

output:

gxr40gvcqh-MEETING-rga0zuq58u
5517385453

result:

ok 2 lines

Test #8:

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

input:

15 1
120499167 737960258 289831217
188517125 861916695 432401208
314969249 489257625 134251335
314969249 479688236 934063647
737960258 915091291 728675035
479688236 915091291 112232840
188517125 489257625 381850362
737960258 737960258 600105949
479688236 915091291 755144458
314969249 811412746 19830...

output:

gxr40gvcqh-MEETING-rga0zuq58u
5223006777

result:

ok 2 lines

Test #9:

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

input:

15 1
266400374 703528681 36393824
594193361 976071354 322705157
154888493 979288360 146631352
322216381 884826148 118504871
105920740 250676363 218705399
46771526 407348616 919508420
65145206 796279271 881762405
105920740 913855482 438273012
250676363 886197297 601198860
413043368 866845047 44053716...

output:

gxr40gvcqh-MEETING-rga0zuq58u
4626188352

result:

ok 2 lines

Test #10:

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

input:

15 1
602765744 659388029 446747353
886778 924974969 66140536
63864811 894375873 887218253
151320987 886529554 545427866
232494922 677832640 227099350
464766957 668586498 66843806
486612493 881877055 922418153
465012711 690832285 819906688
165877800 755783659 60853420
24794931 997302251 802237488
268...

output:

gxr40gvcqh-MEETING-rga0zuq58u
7200638172

result:

ok 2 lines

Test #11:

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

input:

16 1
933616960 933616960 70111222
933616960 933616960 779113265
933616960 933616960 259391202
933616960 933616960 252631766
933616960 933616960 207287046
933616960 933616960 278623020
933616960 933616960 219237273
933616960 933616960 764052293
933616960 933616960 991794984
933616960 933616960 892181...

output:

gxr40gvcqh-MEETING-rga0zuq58u
6225784753

result:

ok 2 lines

Test #12:

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

input:

16 1
651052392 671389169 936295560
280953201 517073052 724325098
942202477 987541587 698116600
280953201 733156640 981815671
280953201 651052392 524001540
280953201 517073052 549499261
213071201 280953201 720811681
280953201 733156640 741159666
517073052 517073052 152953826
213071201 733156640 46420...

output:

gxr40gvcqh-MEETING-rga0zuq58u
7254321392

result:

ok 2 lines

Test #13:

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

input:

16 1
524883191 962211170 966321148
667341153 858112365 131575437
446096717 525047220 930401020
638356526 964764497 213037899
525047220 724960895 573954041
348268484 667341153 931696276
175922688 648075314 739128210
206072260 570755227 261485409
58976272 175922688 276687037
915307492 915307492 290731...

output:

gxr40gvcqh-MEETING-rga0zuq58u
5658331734

result:

ok 2 lines

Test #14:

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

input:

16 1
181038948 762840677 253259515
134123759 799291629 846054918
10628886 29338960 937961751
39703970 878299059 913965255
358211613 365812014 290874835
55652279 677909046 266988902
166567935 907544528 424308126
502938667 597999829 67601480
331641871 448929982 20863470
41853618 433958813 149913364
21...

output:

gxr40gvcqh-MEETING-rga0zuq58u
3646373294

result:

ok 2 lines

Test #15:

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

input:

14 11
596868476 596868476 1
596868476 596868476 1
596868476 596868476 1
596868476 596868476 1
596868476 596868476 1
596868476 596868476 1
596868476 596868476 1
596868476 596868476 1
596868476 596868476 1
596868476 596868476 1
596868476 596868476 1
596868476 596868476 1
596868476 596868476 1
59686847...

output:

gxr40gvcqh-MEETING-rga0zuq58u
3

result:

ok 2 lines

Test #16:

score: -10
Wrong Answer
time: 1ms
memory: 4060kb

input:

14 8
299755849 335236157 1
549362417 916670570 1
335236157 947600061 1
249715205 598937209 1
249715205 598937209 1
549362417 549362417 1
335236157 534977292 1
534977292 598937209 1
534977292 916670570 1
249715205 387109674 1
249715205 947600061 1
534977292 947600061 1
534977292 598937209 1
534977292...

output:

gxr40gvcqh-MEETING-rga0zuq58u
6

result:

wrong answer 2nd lines differ - expected: '5', found: '6'

Subtask #2:

score: 17
Accepted

Test #64:

score: 17
Accepted
time: 1ms
memory: 3764kb

input:

248 1
798307257 798307257 359993686
798307257 798307257 812363141
798307257 798307257 872983330
798307257 798307257 537223276
798307257 798307257 375626816
798307257 798307257 518196362
798307257 798307257 474572280
798307257 798307257 277617903
798307257 798307257 473712578
798307257 798307257 5366...

output:

gxr40gvcqh-MEETING-rga0zuq58u
119894782350

result:

ok 2 lines

Test #65:

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

input:

248 1
106716204 134413027 820571410
639195985 658024378 685768282
22383466 885531934 273730628
106716204 885531934 67224076
106716204 885531934 984556051
151623368 527066675 495233434
106716204 538526558 54768332
134413027 538526558 885649153
106716204 885531934 467319104
508538911 527066675 2628753...

output:

gxr40gvcqh-MEETING-rga0zuq58u
123443346507

result:

ok 2 lines

Test #66:

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

input:

248 1
459464034 997962180 761229184
227479654 273550682 80511490
174747895 624745165 534879740
130619474 752848651 703375936
110505930 869151139 645656606
174430647 777916252 351250186
320313925 357598946 932041340
214550801 265733786 381197847
199191480 512169278 290848269
214550801 569697779 88717...

output:

gxr40gvcqh-MEETING-rga0zuq58u
115974717700

result:

ok 2 lines

Test #67:

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

input:

248 1
712161748 857098296 483281188
635238057 843933145 219483541
840156851 968434599 289113173
233731925 667800790 975105667
79096556 418458947 932773275
294354627 806377423 40986123
446437143 698187074 966903557
51500257 286424379 266246550
547772784 737573545 102689016
604191629 896399185 6902062...

output:

gxr40gvcqh-MEETING-rga0zuq58u
116538147809

result:

ok 2 lines

Test #68:

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

input:

249 1
233111944 233111944 285960545
233111944 233111944 486623581
233111944 233111944 665559228
233111944 233111944 199385087
233111944 233111944 363907243
233111944 233111944 391627084
233111944 233111944 621636028
233111944 233111944 647501221
233111944 233111944 201059139
233111944 233111944 2497...

output:

gxr40gvcqh-MEETING-rga0zuq58u
121970149470

result:

ok 2 lines

Test #69:

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

input:

249 1
202663893 202663893 467035753
13852711 204515010 417883660
263027776 744759927 132563188
271909522 744759927 969751908
51319244 202663893 779882557
204515010 271909522 667658639
13852711 271909522 803795058
744759927 977050385 321670167
13852711 271909522 160095769
51319244 204515010 528777752...

output:

gxr40gvcqh-MEETING-rga0zuq58u
120570950601

result:

ok 2 lines

Test #70:

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

input:

249 1
530074088 646491346 712965538
423805584 782427209 565458576
324887848 571639938 880590535
865571353 933517419 71913324
810570146 961105236 859175195
200382842 392923562 551395283
16496713 398088551 433931313
31171330 399321359 923859936
719360691 853214314 250858319
232634960 991281525 2348525...

output:

gxr40gvcqh-MEETING-rga0zuq58u
109509467071

result:

ok 2 lines

Test #71:

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

input:

249 1
482591031 950477424 603537513
586394313 630417040 976764951
70174900 703482916 864993520
802114977 843452033 909130125
522920470 617574055 985417847
94722043 124804691 62141126
54891725 743264793 64668427
265325294 308884398 224768111
400928204 401249869 901913628
494669349 658087227 997901531...

output:

gxr40gvcqh-MEETING-rga0zuq58u
112140093460

result:

ok 2 lines

Test #72:

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

input:

250 1
791357881 791357881 798775363
791357881 791357881 138269412
791357881 791357881 307845195
791357881 791357881 744824622
791357881 791357881 176142409
791357881 791357881 437271206
791357881 791357881 534155807
791357881 791357881 80464929
791357881 791357881 50063538
791357881 791357881 988173...

output:

gxr40gvcqh-MEETING-rga0zuq58u
113493854665

result:

ok 2 lines

Test #73:

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

input:

250 1
531555466 780895069 103184151
780895069 935560777 202473615
531555466 963941525 128172918
151192560 374694117 28096208
290113341 290113341 189814034
935560777 963941525 520372727
151192560 780895069 205494163
318814550 374694117 857332391
121832866 780895069 135837751
151192560 205368507 97537...

output:

gxr40gvcqh-MEETING-rga0zuq58u
114626749094

result:

ok 2 lines

Test #74:

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

input:

250 1
256266618 430895252 326029865
118535250 563687218 614131176
7574692 330426895 244679752
27918287 600335600 711027519
108116184 894068489 56008681
432845906 893598879 102519231
727590279 870779611 254977288
282077314 654078599 437187215
753180632 901346436 876422805
139294964 502567982 68596096...

output:

gxr40gvcqh-MEETING-rga0zuq58u
114846406923

result:

ok 2 lines

Test #75:

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

input:

250 1
326551712 946016786 422346564
733200676 810455411 698309833
642204270 659267579 189695156
214815662 471444425 375956910
65325779 658198845 143978223
329622763 488116519 987927336
13580152 269613480 198328227
231079582 411625445 640598951
536659354 622392781 545008672
174030034 175247730 750871...

output:

gxr40gvcqh-MEETING-rga0zuq58u
119108635627

result:

ok 2 lines

Test #76:

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

input:

2498 1
740414026 740414026 682362951
740414026 740414026 49781169
740414026 740414026 894368353
740414026 740414026 201846585
740414026 740414026 668002204
740414026 740414026 286086687
740414026 740414026 274540672
740414026 740414026 403960534
740414026 740414026 910333450
740414026 740414026 7782...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1243815989704

result:

ok 2 lines

Test #77:

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

input:

2498 1
376815978 784154428 799475096
146846757 785999437 837169657
352897418 447518164 260111342
76210743 403812323 918289074
181528752 403812323 501057170
547559559 708821240 710699164
366655650 910113091 912200598
145605162 759720168 836619825
105846076 757272250 993492094
159308475 243618997 8044...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1221239123188

result:

ok 2 lines

Test #78:

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

input:

2498 1
481531493 575959962 846989814
292115184 845546193 357012603
193948012 556114064 862201258
176895958 825932485 765183181
71685264 321625312 726377491
589856171 872807561 27916123
169518375 333900883 702089299
980334902 990336734 106813377
415899886 449406486 294544928
8106270 179715350 6385416...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1197466006246

result:

ok 2 lines

Test #79:

score: 0
Accepted
time: 13ms
memory: 3928kb

input:

2498 1
473284820 616994625 218259130
439882485 657362310 103879944
304692620 321068623 467502082
229286624 410590306 190972126
208887976 786996328 926435246
466629937 738697087 930697958
345537760 389109539 142233883
669293423 892187202 672351501
843370796 995065998 395613671
71926871 955815223 4666...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1224278752800

result:

ok 2 lines

Test #80:

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

input:

2499 1
175218713 175218713 608329810
175218713 175218713 724041609
175218713 175218713 537201147
175218713 175218713 718784204
175218713 175218713 96474118
175218713 175218713 159517409
175218713 175218713 421604420
175218713 175218713 919068044
175218713 175218713 637680011
175218713 175218713 7862...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1260612494575

result:

ok 2 lines

Test #81:

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

input:

2499 1
27143533 180138892 729402421
72618608 823840951 500815745
249293350 866395015 748913714
608555748 769607159 12822102
765175253 779024558 856305812
205174259 720469320 577662829
429220889 762936977 914790596
267423944 349290391 659832223
208123652 276280851 668980271
762936977 866395015 610930...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1209098878876

result:

ok 2 lines

Test #82:

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

input:

2499 1
223389269 354869729 672278844
37086638 833270463 114294013
22484842 433429998 143114308
312262166 434331330 699207640
127815258 628472068 484054766
298759408 907627960 754103831
216687412 578002786 945078360
243021621 959233524 920110746
84453850 669371859 93769540
432432324 772394178 9462369...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1208076073784

result:

ok 2 lines

Test #83:

score: 0
Accepted
time: 13ms
memory: 3916kb

input:

2499 1
688299105 833927125 371190405
394552744 813731277 768333356
510351989 919730928 645745304
595297617 936184837 686545831
97329022 519292591 896953781
86281274 518822462 799269897
101383348 661811365 693584529
535329794 946013786 637767378
91671640 742416150 8944153
86424174 915529194 635599094...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1221733062124

result:

ok 2 lines

Test #84:

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

input:

2500 1
861406195 861406195 941646605
861406195 861406195 15058113
861406195 861406195 637023741
861406195 861406195 685507943
861406195 861406195 442553232
861406195 861406195 19761769
861406195 861406195 665639413
861406195 861406195 65968704
861406195 861406195 666433167
861406195 861406195 377169...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1254903429773

result:

ok 2 lines

Test #85:

score: 0
Accepted
time: 10ms
memory: 4092kb

input:

2500 1
294946196 395007211 133300553
590619890 655422496 263263663
754160892 990798090 920118720
307247218 474792879 648992340
175416154 867916821 576013886
354033474 600930103 35197630
248745546 778798217 164316986
581833003 754160892 963755053
431076992 778798217 708232031
165880752 672987607 5368...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1228524080617

result:

ok 2 lines

Test #86:

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

input:

2500 1
77553246 649972787 639869511
236600589 799335427 386150323
134619917 623518654 356370793
383853788 674311846 297132662
163285474 484965589 69926419
382282851 582084327 626583867
463398146 897589995 139586429
767652028 920154567 915468051
581362908 605223890 371013170
186533049 309285431 45243...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1227763857099

result:

ok 2 lines

Test #87:

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

input:

2500 1
107607642 293083323 617230901
157878171 906382175 175390866
188903213 965267179 696293479
617468779 832369623 350467980
578082318 581555780 437158102
357567905 921969936 832941465
69586653 199375548 600306029
141563331 155812468 898502197
83935326 512041182 771898461
485046112 717551275 52873...

output:

gxr40gvcqh-MEETING-rga0zuq58u
1221451949791

result:

ok 2 lines

Subtask #3:

score: 0
Wrong Answer

Test #88:

score: 32
Accepted
time: 1ms
memory: 4124kb

input:

248 135
806992812 806992812 1
806992812 806992812 1
806992812 806992812 1
806992812 806992812 1
806992812 806992812 1
806992812 806992812 1
806992812 806992812 1
806992812 806992812 1
806992812 806992812 1
806992812 806992812 1
806992812 806992812 1
806992812 806992812 1
806992812 806992812 1
806992...

output:

gxr40gvcqh-MEETING-rga0zuq58u
113

result:

ok 2 lines

Test #89:

score: -32
Wrong Answer
time: 0ms
memory: 3856kb

input:

248 40
377400510 615563728 1
533035619 865270129 1
320586735 587946481 1
432205649 615563728 1
320586735 615563728 1
723259390 723259390 1
467410161 587946481 1
467410161 467410161 1
533035619 587946481 1
533035619 615563728 1
377400510 723259390 1
432205649 865270129 1
320586735 377400510 1
3205867...

output:

gxr40gvcqh-MEETING-rga0zuq58u
169

result:

wrong answer 2nd lines differ - expected: '168', found: '169'

Subtask #4:

score: 0
Skipped

Dependency #1:

0%

Subtask #5:

score: 0
Skipped

Dependency #1:

0%