QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#370359 | #4089. 회의실 | seojinhyeong99 | 0 | 3ms | 4216kb | C++17 | 1.6kb | 2024-03-29 02:30:20 | 2024-03-29 02:30:21 |
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]) 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;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 10
Accepted
time: 1ms
memory: 3752kb
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: 0ms
memory: 4072kb
input:
1 1 260947663 693934985 986106006
output:
gxr40gvcqh-MEETING-rga0zuq58u 0
result:
ok 2 lines
Test #3:
score: 0
Accepted
time: 1ms
memory: 3788kb
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: 3788kb
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: 3836kb
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: 1ms
memory: 3840kb
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: 0ms
memory: 3740kb
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: 1ms
memory: 3776kb
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: 0ms
memory: 4068kb
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: 0ms
memory: 3840kb
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: 3728kb
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: 1ms
memory: 4052kb
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: 1ms
memory: 3836kb
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: 1ms
memory: 3780kb
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: 3780kb
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: 0
Accepted
time: 1ms
memory: 3792kb
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 5
result:
ok 2 lines
Test #17:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
14 14 147077273 719770043 1 249885468 453139504 1 289057660 904925065 1 468494784 501341613 1 470093219 615748838 1 95634637 468494784 1 196514909 441683724 1 126680367 514163748 1 93396333 851469378 1 93396333 758192196 1 679314973 780706964 1 273889708 464038211 1 472588578 861023617 1 275820318 6...
output:
gxr40gvcqh-MEETING-rga0zuq58u 0
result:
ok 2 lines
Test #18:
score: -10
Wrong Answer
time: 0ms
memory: 3776kb
input:
14 9 32194836 867511040 1 24929426 600929236 1 645179903 761449596 1 272098490 403964909 1 162554009 761001282 1 86735752 758283025 1 31569697 888406642 1 227882500 787874983 1 139365753 600929236 1 661812069 779073277 1 53830370 91705473 1 22000363 80904211 1 166028140 221764108 1 239136240 6436796...
output:
gxr40gvcqh-MEETING-rga0zuq58u 5
result:
wrong answer 2nd lines differ - expected: '4', found: '5'
Subtask #2:
score: 0
Time Limit Exceeded
Test #64:
score: 17
Accepted
time: 3ms
memory: 4052kb
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: 3792kb
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: 1ms
memory: 4052kb
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: 4088kb
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: 3ms
memory: 3832kb
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: 3812kb
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: 3832kb
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: 3820kb
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: 3ms
memory: 3832kb
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: 3868kb
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: 3788kb
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: 1ms
memory: 3828kb
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: -17
Time Limit Exceeded
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:
Unauthorized output
result:
Subtask #3:
score: 0
Wrong Answer
Test #88:
score: 32
Accepted
time: 3ms
memory: 4212kb
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: 0
Accepted
time: 2ms
memory: 3948kb
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 168
result:
ok 2 lines
Test #90:
score: -32
Wrong Answer
time: 1ms
memory: 4216kb
input:
248 217 147347540 594161740 1 723258860 877210169 1 425066537 464064708 1 1869932 404268491 1 411187789 594161740 1 610041829 934781812 1 445073195 464263549 1 169499667 523255757 1 154234015 607147611 1 223642273 275350834 1 106759254 754292364 1 607766410 903195689 1 147347540 580630975 1 18977368...
output:
gxr40gvcqh-MEETING-rga0zuq58u 31
result:
wrong answer 2nd lines differ - expected: '29', found: '31'
Subtask #4:
score: 0
Skipped
Dependency #1:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
0%