QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#814004 | #8916. Беспилотная аэрологистика | ucup-team004 | 100 ✓ | 18ms | 4308kb | C++23 | 782b | 2024-12-14 14:22:51 | 2024-12-14 14:22:52 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, m, c, p;
std::cin >> n >> m >> c >> p;
std::vector<i64> a;
i64 sum = 0;
for (int i = 0; i < n + m; i++) {
int t, h;
std::cin >> t >> h;
if (t == 1) {
sum += h;
} else {
a.push_back(sum + h);
}
}
std::sort(a.begin(), a.end());
i64 ans = 0;
for (int i = 1; i <= a.size(); i++) {
ans = std::max(ans, 1LL * i * p - 1LL * c * (a[i - 1] - 1));
}
std::cout << ans << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 24
Accepted
Test #1:
score: 24
Accepted
time: 0ms
memory: 3844kb
input:
0 0 1000000 1000000
output:
0
result:
ok answer is '0'
Test #2:
score: 24
Accepted
time: 0ms
memory: 3648kb
input:
100 100 1 30 2 11 1 10 1 21 1 37 1 35 1 29 1 21 1 1 1 39 2 36 1 7 2 12 1 22 1 20 2 65 2 68 2 91 1 34 2 79 1 11 2 28 1 18 2 100 2 10 2 61 1 30 2 61 2 64 2 37 2 34 2 18 2 7 2 32 2 41 2 56 1 25 1 20 1 31 2 71 1 40 1 15 1 26 1 22 1 14 2 61 2 4 1 34 2 16 1 24 1 9 1 5 2 11 2 88 2 46 2 61 1 36 1 1 1 15 1 2...
output:
747
result:
ok answer is '747'
Test #3:
score: 24
Accepted
time: 0ms
memory: 3576kb
input:
100 100 228 1 1 1 1 1 2 24 2 5 1 1 2 26 2 29 2 2 2 18 1 1 2 27 1 1 2 27 1 1 2 20 1 1 1 1 1 1 2 21 1 1 1 1 2 30 1 1 1 1 2 5 2 19 1 1 1 1 2 4 2 4 2 5 1 1 2 19 2 12 2 21 2 21 2 28 2 2 2 26 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 6 1 1 2 5 2 26 2 29 1 1 2 25 1 1 2 10 2 8 1 1 2 29 2 27 2 7 1 1 1 1 2 13 2 1 1 1...
output:
0
result:
ok answer is '0'
Test #4:
score: 24
Accepted
time: 0ms
memory: 3500kb
input:
100 100 1000000 1000000 2 2 1 1 2 1 2 1 1 1 1 1 1 1 1 1 1 1 2 5 1 1 1 1 1 1 2 1 1 1 1 1 2 1 2 4 2 5 1 1 1 1 1 1 2 1 1 1 2 5 1 1 2 1 2 1 1 1 1 1 1 1 1 1 1 1 2 4 1 1 1 1 1 1 1 1 2 3 2 2 2 3 2 2 2 4 2 4 1 1 1 1 1 1 2 2 1 1 2 5 2 4 2 5 1 1 2 2 2 5 1 1 2 5 2 3 1 1 1 1 1 1 2 2 2 5 1 1 2 1 1 1 1 1 2 4 1 1 ...
output:
2000000
result:
ok answer is '2000000'
Test #5:
score: 24
Accepted
time: 0ms
memory: 3608kb
input:
9 100 1 1 2 74 2 79 2 10 2 80 2 87 2 34 2 20 2 24 2 69 2 75 2 1 2 82 2 39 2 79 2 89 2 72 2 1 2 33 2 84 2 65 2 8 2 1 2 85 2 47 2 97 2 34 2 16 2 75 2 1 2 78 2 70 2 62 2 85 2 44 2 6 2 79 2 31 2 2 2 25 2 83 2 41 2 81 2 62 2 69 2 63 2 1 2 89 2 81 2 86 2 25 2 66 2 38 2 5 2 1 2 43 2 23 2 48 2 49 2 94 2 89 ...
output:
15
result:
ok answer is '15'
Test #6:
score: 24
Accepted
time: 0ms
memory: 3552kb
input:
10 98 1 2 1 3 2 96 1 2 2 94 2 94 2 94 2 94 2 89 2 94 2 77 2 92 2 94 2 66 2 94 2 85 2 94 2 93 2 94 2 21 2 94 2 92 2 94 2 88 2 94 2 94 2 94 2 94 2 94 2 85 2 94 2 29 2 94 2 94 2 94 2 17 2 94 2 7 2 94 2 94 2 92 2 94 2 94 2 90 2 93 2 3 2 94 2 38 2 94 2 51 2 25 2 67 2 94 2 92 2 94 2 94 2 47 2 61 2 17 2 87...
output:
98
result:
ok answer is '98'
Test #7:
score: 24
Accepted
time: 0ms
memory: 3648kb
input:
1 99 1 1 2 76 2 51 2 61 2 30 2 1 2 1 2 1 2 1 2 31 2 1 2 3 2 98 2 1 2 1 2 1 2 1 2 96 2 39 2 20 2 2 2 14 2 1 2 61 2 84 2 40 2 1 2 1 2 1 2 1 2 43 2 83 2 40 2 42 2 38 2 17 2 35 2 1 2 1 2 1 2 1 2 1 2 1 2 68 2 1 2 1 2 44 2 1 2 81 2 1 2 28 2 1 2 1 2 40 2 24 2 1 2 61 2 1 2 13 2 81 2 1 2 1 2 79 2 81 2 36 2 1...
output:
50
result:
ok answer is '50'
Test #8:
score: 24
Accepted
time: 0ms
memory: 3556kb
input:
0 100 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 76 2 1 2 1 2 1 2 1 2 16 2 1 2 1 2 1 2 73 2 1 2 15 2 1 2 1 2 1 2 27 2 1 2 29 2 1 2 1 2 9 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 8 2 12 2 1 2 22 2 1 2 1 2 2 2 1 2 13 2 1 2 15 2 1 2 1 2 1 2 14 2 1 2 1 2 1 2 1 2 1 2 46 2 1 2 1 2 1 2 1 2 1 2 65 2 73 2 1 2 1 2 1 2 1 2 1 ...
output:
75
result:
ok answer is '75'
Test #9:
score: 24
Accepted
time: 0ms
memory: 3776kb
input:
100 100 1000000 1000000 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 ...
output:
0
result:
ok answer is '0'
Test #10:
score: 24
Accepted
time: 0ms
memory: 3540kb
input:
100 100 1 1000000 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 2 100 ...
output:
99999901
result:
ok answer is '99999901'
Subtask #2:
score: 12
Accepted
Test #11:
score: 12
Accepted
time: 0ms
memory: 3508kb
input:
0 0 1000000 1000000
output:
0
result:
ok answer is '0'
Test #12:
score: 12
Accepted
time: 0ms
memory: 3616kb
input:
0 20 1 30 2 28 2 23 2 38 2 40 2 52 2 1 2 5 2 35 2 68 2 39 2 11 2 53 2 66 2 7 2 70 2 70 2 15 2 36 2 6 2 35
output:
531
result:
ok answer is '531'
Test #13:
score: 12
Accepted
time: 10ms
memory: 4136kb
input:
0 100000 228 1 2 18 2 22 2 14 2 15 2 16 2 4 2 21 2 11 2 25 2 2 2 6 2 29 2 27 2 24 2 17 2 7 2 11 2 17 2 12 2 8 2 15 2 4 2 20 2 26 2 2 2 12 2 1 2 29 2 24 2 2 2 19 2 9 2 11 2 20 2 21 2 21 2 5 2 19 2 28 2 9 2 1 2 28 2 6 2 4 2 2 2 15 2 18 2 13 2 8 2 22 2 27 2 29 2 16 2 25 2 25 2 19 2 15 2 18 2 29 2 7 2 2...
output:
93388
result:
ok answer is '93388'
Test #14:
score: 12
Accepted
time: 0ms
memory: 3584kb
input:
0 100 1000000 1000000 2 422813 2 83240 2 515915 2 724595 2 243667 2 559507 2 674452 2 774542 2 995601 2 819472 2 563913 2 398518 2 159018 2 759055 2 782135 2 474686 2 679079 2 137111 2 303208 2 656996 2 68032 2 742514 2 207089 2 690895 2 549238 2 516681 2 806809 2 625655 2 515472 2 76106 2 788321 2 ...
output:
0
result:
ok answer is '0'
Test #15:
score: 12
Accepted
time: 14ms
memory: 4192kb
input:
0 99900 5 16 2 337191 2 189645 2 269693 2 201375 2 471019 2 380686 2 462676 2 461223 2 130557 2 462032 2 1273 2 216481 2 115893 2 291766 2 282897 2 289083 2 482651 2 353850 2 467145 2 348040 2 402350 2 412685 2 394343 2 171625 2 464260 2 106633 2 451654 2 170201 2 190769 2 28677 2 265233 2 332629 2 ...
output:
20
result:
ok answer is '20'
Test #16:
score: 12
Accepted
time: 14ms
memory: 4136kb
input:
0 100000 10 61 2 542091 2 444220 2 601138 2 421099 2 864194 2 115955 2 73402 2 314350 2 333290 2 579253 2 405699 2 801232 2 901412 2 944688 2 170779 2 468027 2 463535 2 699069 2 900713 2 575523 2 636721 2 430059 2 221053 2 157486 2 612034 2 655291 2 56602 2 400463 2 796877 2 495362 2 74193 2 12607 2...
output:
1
result:
ok answer is '1'
Test #17:
score: 12
Accepted
time: 14ms
memory: 4140kb
input:
0 100000 10 71 2 331576 2 209489 2 780962 2 727336 2 784068 2 203791 2 850425 2 437264 2 723267 2 307520 2 957168 2 601549 2 204806 2 193771 2 930756 2 82999 2 593696 2 229680 2 263312 2 170753 2 711202 2 727735 2 281176 2 904756 2 474808 2 612553 2 388272 2 798078 2 342112 2 962364 2 807792 2 24696...
output:
30010
result:
ok answer is '30010'
Test #18:
score: 12
Accepted
time: 14ms
memory: 4216kb
input:
0 100000 10 61 2 124590 2 85002 2 246552 2 229374 2 382283 2 64632 2 204372 2 425989 2 267924 2 421014 2 453395 2 703395 2 623775 2 75696 2 507771 2 547846 2 495528 2 354522 2 417112 2 420342 2 600812 2 866863 2 212089 2 609326 2 201984 2 870285 2 14490 2 583952 2 363116 2 396696 2 110382 2 408200 2...
output:
75010
result:
ok answer is '75010'
Test #19:
score: 12
Accepted
time: 14ms
memory: 4184kb
input:
0 100000 5 21 2 35824 2 388639 2 367987 2 157964 2 393645 2 284785 2 158352 2 250992 2 258636 2 342843 2 40284 2 273075 2 154640 2 266976 2 66990 2 328957 2 325668 2 360568 2 331639 2 395119 2 120022 2 82648 2 312788 2 368192 2 75196 2 395102 2 223160 2 98248 2 157324 2 97232 2 361428 2 333197 2 159...
output:
100005
result:
ok answer is '100005'
Test #20:
score: 12
Accepted
time: 6ms
memory: 4212kb
input:
0 100000 1000000 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 100...
output:
0
result:
ok answer is '0'
Test #21:
score: 12
Accepted
time: 9ms
memory: 4148kb
input:
0 100000 1 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2...
output:
99999000001
result:
ok answer is '99999000001'
Subtask #3:
score: 14
Accepted
Test #22:
score: 14
Accepted
time: 0ms
memory: 3804kb
input:
1 0 1000000 1000000 1 1
output:
0
result:
ok answer is '0'
Test #23:
score: 14
Accepted
time: 0ms
memory: 3480kb
input:
1 20 1 30 2 28 2 40 2 35 2 27 2 4 2 38 2 44 2 70 2 29 2 30 2 54 2 12 2 62 2 27 2 28 2 33 2 41 2 25 2 15 1 5 2 27
output:
531
result:
ok answer is '531'
Test #24:
score: 14
Accepted
time: 6ms
memory: 4096kb
input:
1 100000 228 1 2 6 2 13 2 4 2 21 2 16 2 19 2 19 2 24 2 10 2 12 2 13 2 9 2 12 2 16 2 10 2 21 2 19 2 8 2 13 2 21 2 14 2 18 2 24 2 8 2 25 2 25 2 2 2 22 2 5 2 22 2 30 2 18 2 7 2 11 2 10 2 22 2 1 2 2 2 8 2 27 2 16 2 4 2 9 2 21 2 8 2 25 2 26 2 30 2 1 2 28 2 5 2 7 2 27 2 26 2 18 2 23 2 28 2 7 2 14 2 4 2 22...
output:
91108
result:
ok answer is '91108'
Test #25:
score: 14
Accepted
time: 0ms
memory: 3808kb
input:
1 100 1000000 1000000 2 980763 2 617445 2 605757 2 621494 2 873065 2 784447 2 871728 2 386849 2 217986 1 13 2 961103 2 674665 2 885305 2 320519 2 683742 2 248180 2 772245 2 150939 2 95068 2 522050 2 288139 2 612003 2 204729 2 692976 2 763678 2 97773 2 222178 2 639490 2 265349 2 740141 2 806555 2 711...
output:
0
result:
ok answer is '0'
Test #26:
score: 14
Accepted
time: 13ms
memory: 4116kb
input:
1 99900 5 26 2 500000 2 471639 2 500000 2 475854 2 422225 2 233283 2 485762 2 290481 2 218529 2 38025 2 317178 2 273990 2 420885 2 424107 2 500000 2 372987 2 500000 2 68052 2 254917 2 497563 2 85479 2 18003 2 302858 2 482661 2 297699 2 500000 2 500000 2 499527 2 277419 2 367469 2 399755 2 486657 2 5...
output:
97405
result:
ok answer is '97405'
Test #27:
score: 14
Accepted
time: 14ms
memory: 4176kb
input:
1 100000 10 31 2 143972 2 664500 2 406719 2 49944 2 165440 2 51084 2 192100 2 986983 2 507722 2 647104 2 318428 2 110028 2 148696 2 244692 2 796743 2 992625 2 306008 2 248084 2 36920 2 30192 2 786063 2 789959 2 44668 2 811084 2 119080 2 82236 2 289744 2 501372 2 248040 2 350763 2 193292 2 439301 2 6...
output:
1
result:
ok answer is '1'
Test #28:
score: 14
Accepted
time: 9ms
memory: 4144kb
input:
1 100000 10 81 2 228005 2 583796 2 846522 2 626910 2 397401 2 231160 2 827768 2 971440 2 137561 2 689289 2 772584 2 167884 2 448800 2 442203 2 985644 2 565611 2 26584 2 581865 2 91865 2 239601 2 742579 2 654658 2 834387 2 97280 2 533706 2 743412 2 192880 2 189620 2 208400 2 87528 2 516822 2 645648 2...
output:
30010
result:
ok answer is '30010'
Test #29:
score: 14
Accepted
time: 11ms
memory: 4188kb
input:
1 100000 10 31 2 566908 2 153084 2 125277 2 643893 2 259284 2 129182 2 161453 2 45342 2 112341 2 157742 2 200821 2 215250 2 214048 2 219395 2 212971 2 217774 2 56238 2 171970 2 194089 2 92751 2 140766 2 115995 2 254908 2 217434 2 116487 2 691639 2 300352 2 93260 2 477272 2 251180 2 266020 2 74994 2 ...
output:
75010
result:
ok answer is '75010'
Test #30:
score: 14
Accepted
time: 14ms
memory: 4300kb
input:
1 100000 5 6 2 59186 2 25975 2 94691 2 61818 2 74939 2 81032 2 87173 2 97922 2 44105 2 11056 2 83724 2 69144 2 70770 2 97562 2 80562 2 43737 2 11244 2 70824 2 18616 2 87588 2 91722 2 81891 2 54380 2 96309 2 47525 2 56401 2 44255 2 92536 2 72305 2 97822 2 39455 2 98984 2 2434 2 98948 2 57816 2 70549 ...
output:
99995
result:
ok answer is '99995'
Test #31:
score: 14
Accepted
time: 9ms
memory: 4172kb
input:
1 100000 1000000 1000000 1 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 100...
output:
0
result:
ok answer is '0'
Test #32:
score: 14
Accepted
time: 9ms
memory: 4116kb
input:
1 100000 1 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2...
output:
99999000001
result:
ok answer is '99999000001'
Subtask #4:
score: 15
Accepted
Test #33:
score: 15
Accepted
time: 0ms
memory: 3584kb
input:
0 1 1 3 2 1
output:
3
result:
ok answer is '3'
Test #34:
score: 15
Accepted
time: 6ms
memory: 3556kb
input:
100000 1 1 1000000 1 2 1 2 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 2 1 2 1 2 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 2 1 2 1 1 1 1 1 1 1 2 1 2 1 2 1 2 1 2 1 1 1 1 1 2 1 1 1 2 1 2 1 1 1 2 1 1 1 1 1 2 1 1 1 2 1 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 1 1 1 1 2 1 1 1 2 1 1 1 1 1 2 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 2 1...
output:
985034
result:
ok answer is '985034'
Test #35:
score: 15
Accepted
time: 3ms
memory: 3812kb
input:
100000 1 1 30000 1 5 1 4 1 2 1 2 1 5 1 2 1 3 1 3 1 3 1 1 1 3 1 1 1 1 1 2 1 3 1 3 1 3 1 5 1 4 1 1 1 3 1 5 1 1 1 1 1 3 1 1 1 2 1 4 1 4 1 5 1 4 1 3 1 4 1 2 1 1 1 1 1 5 1 4 1 2 1 2 1 5 1 2 1 2 1 1 1 4 1 4 1 4 1 3 1 2 1 2 1 2 1 3 1 4 1 2 1 5 1 3 1 5 1 2 1 1 1 2 1 5 1 3 1 3 1 4 1 1 1 5 1 2 1 5 1 3 1 1 1 4...
output:
0
result:
ok answer is '0'
Test #36:
score: 15
Accepted
time: 0ms
memory: 3652kb
input:
1000 1 1 1000 1 1 1 1 1 2 1 1 1 1 1 2 1 2 1 1 1 2 1 2 1 2 1 1 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 2 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 1 1 2 1 2 1 2 1 2 1 2 1 ...
output:
0
result:
ok answer is '0'
Test #37:
score: 15
Accepted
time: 0ms
memory: 3604kb
input:
0 1 500000 1 2 1
output:
1
result:
ok answer is '1'
Test #38:
score: 15
Accepted
time: 0ms
memory: 3804kb
input:
0 1 1000000 1 2 1
output:
1
result:
ok answer is '1'
Test #39:
score: 15
Accepted
time: 2ms
memory: 3548kb
input:
29156 1 100000 1 1 1 1 2 1 1 1 1 1 3 1 2 1 2 1 7 1 1 1 1 1 2 1 2 1 3 1 2 1 6 1 6 1 1 1 2 1 1 1 2 1 1 1 3 1 1 1 1 1 3 1 4 1 2 1 4 1 4 1 3 1 1 1 1 1 3 1 4 1 1 1 3 1 5 1 2 1 3 1 1 1 2 1 4 1 1 1 2 1 2 1 8 1 1 1 7 1 7 1 1 1 4 1 5 1 4 1 2 1 3 1 4 1 11 1 1 1 2 1 2 1 2 1 1 1 1 1 1 1 5 1 1 1 5 1 6 1 1 1 1 1 ...
output:
0
result:
ok answer is '0'
Test #40:
score: 15
Accepted
time: 8ms
memory: 3556kb
input:
100000 1 500000 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000...
output:
0
result:
ok answer is '0'
Test #41:
score: 15
Accepted
time: 8ms
memory: 3504kb
input:
100000 1 1 1000000 2 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1...
output:
1
result:
ok answer is '1'
Subtask #5:
score: 17
Accepted
Test #42:
score: 17
Accepted
time: 0ms
memory: 3772kb
input:
0 0 1 1000000
output:
0
result:
ok answer is '0'
Test #43:
score: 17
Accepted
time: 16ms
memory: 4280kb
input:
100000 100000 1 1000000 1 1 2 65 1 1 2 68 2 10 2 15 1 1 2 60 2 47 2 47 1 1 2 30 1 1 2 93 1 1 1 1 2 27 2 18 2 7 1 1 1 1 2 85 1 1 2 75 1 1 1 1 2 37 1 1 2 14 1 1 2 63 1 1 2 3 1 1 2 45 2 6 2 100 2 41 1 1 2 29 2 35 1 1 2 91 2 55 1 1 2 53 2 79 1 1 1 1 2 70 2 22 2 73 2 48 1 1 2 83 2 86 1 1 1 1 2 3 1 1 2 72...
output:
99999899908
result:
ok answer is '99999899908'
Test #44:
score: 17
Accepted
time: 14ms
memory: 4280kb
input:
100000 100000 1 1000000 2 971322 1 1 2 493912 2 385553 1 1 2 450163 1 1 2 843577 1 1 2 57943 2 913356 2 474894 1 1 2 411139 2 958780 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 203269 1 1 2 624377 2 914750 1 1 2 193662 2 290213 2 149995 1 1 1 1 2 422147 1 1 2 643717 1 1 1 1 1 1 2 743670 2 32949 1 1 2 543682 1 1 1...
output:
99998901493
result:
ok answer is '99998901493'
Test #45:
score: 17
Accepted
time: 14ms
memory: 4228kb
input:
1000 100000 1 1000000 2 173605 2 30030 2 853994 1 1 1 1 2 16473 2 897469 2 458378 2 3153 2 216244 2 640092 2 434731 2 892237 2 260257 2 443798 2 917114 2 889116 2 63719 2 821319 2 55960 2 784383 2 793826 2 251153 2 732768 2 147466 2 606574 2 487552 1 1 2 16728 2 157275 2 269552 2 783503 2 343698 2 1...
output:
99998999224
result:
ok answer is '99998999224'
Test #46:
score: 17
Accepted
time: 12ms
memory: 4164kb
input:
100000 100000 1 1000000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
99999900000
result:
ok answer is '99999900000'
Test #47:
score: 17
Accepted
time: 9ms
memory: 4300kb
input:
100000 100000 1 1000000 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ...
output:
100000000000
result:
ok answer is '100000000000'
Subtask #6:
score: 18
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Test #48:
score: 18
Accepted
time: 0ms
memory: 3608kb
input:
10 20 1 30 1 25 1 8 2 70 2 59 2 32 2 49 2 37 2 31 1 15 2 9 1 9 2 24 1 8 2 16 2 67 2 60 2 69 2 45 1 30 2 63 2 58 1 9 2 39 1 1 2 30 1 8 2 53 2 43 2 33 1 1
output:
435
result:
ok answer is '435'
Test #49:
score: 18
Accepted
time: 13ms
memory: 4120kb
input:
100000 100000 228 1 2 13 2 22 1 28 1 9 2 6 1 4 1 26 2 16 2 19 2 9 2 6 2 18 2 18 1 24 2 16 1 23 1 6 1 6 1 5 2 6 1 3 1 24 1 27 2 1 1 16 2 27 1 7 1 12 2 5 1 26 2 1 2 7 2 19 1 9 2 24 2 6 2 15 1 29 1 2 1 21 2 20 2 2 2 19 2 27 1 24 1 19 2 6 1 12 2 26 2 20 1 25 2 13 1 4 1 25 1 3 1 3 1 12 2 21 1 1 1 30 1 1 ...
output:
0
result:
ok answer is '0'
Test #50:
score: 18
Accepted
time: 0ms
memory: 3588kb
input:
3 100 1000000 1000000 2 725271 2 376914 2 780530 2 401004 2 201276 2 986940 2 651767 2 50470 2 541730 2 198701 2 539494 2 545717 2 754223 2 283392 2 939972 1 307430 2 243551 2 774614 2 658105 2 291539 2 426556 2 1000000 2 793536 2 652413 2 993089 2 622122 2 814009 2 510890 2 708714 2 848395 2 193729...
output:
0
result:
ok answer is '0'
Test #51:
score: 18
Accepted
time: 8ms
memory: 3548kb
input:
100000 0 1000000 1000000 1 589383 1 845134 1 847093 1 137036 1 346196 1 926545 1 341916 1 64673 1 758076 1 701335 1 668689 1 254185 1 369918 1 423279 1 301456 1 486255 1 799573 1 979577 1 68404 1 974552 1 699618 1 248199 1 406130 1 578008 1 714296 1 632925 1 306092 1 241223 1 476035 1 275928 1 60657...
output:
0
result:
ok answer is '0'
Test #52:
score: 18
Accepted
time: 14ms
memory: 4248kb
input:
347 99900 5 6 2 174515 2 74105 2 101603 2 88971 2 167275 2 175435 2 479021 2 75353 2 193737 2 43837 2 39809 2 400852 2 192151 2 96957 2 137389 2 51051 2 216930 2 80595 2 479699 2 180265 2 82247 2 113687 2 95769 2 193526 2 382974 2 166961 2 127459 2 188702 2 44079 2 251685 2 309540 2 53960 2 255722 2...
output:
20
result:
ok answer is '20'
Test #53:
score: 18
Accepted
time: 10ms
memory: 4216kb
input:
101 100000 10 31 2 307396 2 302592 2 526647 2 9656 2 188796 1 3 2 677570 2 392857 2 451789 2 286529 2 295881 2 942348 2 369405 2 370433 2 293501 2 239005 2 561185 2 796172 2 652845 2 586720 2 210750 2 15329 2 484745 2 791530 2 225857 2 399141 2 422529 2 541167 2 980177 2 100565 2 598728 2 267893 2 9...
output:
1
result:
ok answer is '1'
Test #54:
score: 18
Accepted
time: 14ms
memory: 4144kb
input:
10 100000 10 11 2 327718 2 46718 2 149848 2 29000 2 25209 2 850947 2 731596 2 93940 2 524309 2 909032 2 706346 2 29505 2 10001 2 138790 2 19860 2 728164 2 712493 2 28637 2 4907 2 505 2 114582 2 633080 2 22220 2 774018 2 29504 2 223487 2 31538 2 568465 2 695919 2 892110 2 10935 2 27955 2 976210 2 753...
output:
30010
result:
ok answer is '30010'
Test #55:
score: 18
Accepted
time: 10ms
memory: 4308kb
input:
49 100000 10 81 2 441198 2 584497 2 260083 2 694986 2 109296 2 68255 2 877620 2 55896 2 35336 2 412872 2 119008 2 560120 2 767260 2 47096 2 411343 2 424616 2 355806 2 4552 2 397411 2 559104 2 396377 2 465086 2 577122 2 204624 2 204600 2 660057 2 726982 2 805821 2 45112 2 337637 2 65728 2 445832 2 57...
output:
75010
result:
ok answer is '75010'
Test #56:
score: 18
Accepted
time: 14ms
memory: 4144kb
input:
12 100000 5 21 2 388664 2 291348 2 386091 2 339704 2 205176 2 218684 2 271523 2 223512 2 58636 2 300476 2 47784 2 334054 2 270584 2 139425 2 399499 2 176860 2 84925 2 350287 2 388192 2 354108 2 175876 2 121268 2 390827 2 344220 2 283462 2 382013 2 172288 2 223009 2 312684 2 202576 2 375761 2 284624 ...
output:
100005
result:
ok answer is '100005'
Test #57:
score: 18
Accepted
time: 18ms
memory: 4120kb
input:
100000 100000 500000 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1...
output:
0
result:
ok answer is '0'
Test #58:
score: 18
Accepted
time: 17ms
memory: 4220kb
input:
100000 100000 1 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000000 2 1000...
output:
99999000001
result:
ok answer is '99999000001'
Extra Test:
score: 0
Extra Test Passed