QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#497303 | #9140. Train Depot | ucup-team3215 | AC ✓ | 185ms | 65628kb | C++20 | 1.5kb | 2024-07-28 22:21:48 | 2024-07-28 22:21:48 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
constexpr int N = 2e5;
vector<array<int, 2>> nei[N];
int st[N], sz, trs;
int64_t dep[N], byt[N];
vector<array<int, 2>> ev[N], tr[N];
vector<int> from[N];
void build(int v, int64_t cd) {
dep[sz] = cd;
st[sz++] = v;
for (auto [u, c]: nei[v]) if (sz == 1 || st[sz - 2] != u) build(u, cd + c);
for (auto t: from[v]) {
int64_t s = 0;
ev[v].push_back({trs++, 0});
for (int i = 0; auto [v, l]: tr[t]) {
if ((s += l) > cd) break;
ev[st[upper_bound(dep, dep + sz, cd - s) - dep]].push_back({trs - 1, v});
}
}
sz--;
}
struct State: vector<int> { int64_t ans, d; };
void merge(State& a, auto&& b) {
if (a.size() < b.size()) return merge(b, a), swap(b, a);
b.d += a.ans;
a.d += b.ans;
a.ans += b.ans;
for (auto& t: b) byt[t] += b.d - a.d, a.push_back(t);
}
State solve(int v, int p) {
State res{};
for (auto [u, c]: nei[v]) if (u != p) merge(res, solve(u, v));
auto ans0 = res.ans;
for (auto& [t, d]: ev[v]) if (res.ans = max(res.ans, res.d + (byt[t] += d ?: ans0 - res.d)), !d) res.push_back(t);
return res;
}
int main() {
cin.tie(0)->sync_with_stdio(0);
int n, m; cin >> n >> m;
for (int i = 1, a, b, c; i < n; ++i) cin >> a >> b >> c, nei[--a].push_back({--b, c}), nei[b].push_back({a, c});
for (int i = 0, k, s; i < m; ++i) {
cin >> k >> s;
from[--s].push_back(i);
tr[i].resize(k);
for (auto t: {0, 1}) for (auto& x: tr[i]) cin >> x[t];
}
build(0, 0);
cout << solve(0, 0).ans;
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 5692kb
input:
4 2 1 2 2 3 2 1 2 4 2 3 3 1 1 1 1 1 1 1 4 3 3
output:
4
result:
ok 1 number(s): "4"
Test #2:
score: 0
Accepted
time: 1ms
memory: 5620kb
input:
6 4 1 2 2 2 3 1 2 4 2 4 5 1 4 6 2 2 3 1 1 2 1 1 5 3 2 1 4 5 4 3 6 1 1 10 1 2 2
output:
12
result:
ok 1 number(s): "12"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
20 5 14 12 2 12 16 6 6 14 8 5 3 10 13 9 5 12 1 6 19 11 10 14 9 1 6 17 6 2 1 6 9 11 1 12 15 2 7 3 3 8 9 7 12 20 5 10 14 8 3 6 8 18 4 2 18 12 8 2 2 278769845 450372138 5 6 2 18 418047008 550087771 7 1 1 7 869502939 6 6 4 689265348 432120785 162165113 226840873 482457380 216313019 8 2 2 1 2 8 9 11 4996...
output:
3912302656
result:
ok 1 number(s): "3912302656"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3860kb
input:
20 10 4 16 9 19 5 1 6 17 9 10 15 5 1 13 7 18 2 4 14 9 10 2 9 5 6 12 9 13 15 7 6 1 1 7 20 6 20 17 10 6 16 3 13 9 5 7 8 8 16 11 6 9 19 10 10 3 5 2 10 680611495 353622078 2 4 1 11 917083657 8 1 13 795633868 1 2 6 617523093 78780257 9 5 1 6 48224663 9 3 13 603622834 838595946 938829004 1 6 4 3 15 705438...
output:
4966301914
result:
ok 1 number(s): "4966301914"
Test #5:
score: 0
Accepted
time: 1ms
memory: 5688kb
input:
20 5 7 3 2 15 16 9 11 9 10 18 1 6 12 20 1 8 4 3 11 4 3 19 2 6 7 2 4 5 18 6 1 4 8 13 11 8 20 17 9 5 14 7 9 6 10 20 16 5 17 10 2 2 10 1 6 12 7 1 11 793592687 1 3 15 704615085 908203915 544852479 3 3 10 1 4 789262647 6 1 11 912612384 5 14 7 777797092 411792157 625360529 958355071 563191751 106051596 30...
output:
8235861111
result:
ok 1 number(s): "8235861111"
Test #6:
score: 0
Accepted
time: 0ms
memory: 5620kb
input:
20 5 9 18 3 2 18 10 3 18 3 14 11 7 4 6 2 15 6 4 18 20 10 10 18 6 18 5 9 17 18 4 18 19 6 16 8 8 16 14 1 18 8 9 12 11 7 4 7 5 15 12 9 18 13 2 1 7 7 2 4 498355326 486381067 2 5 7 4 473976266 387719748 910071581 811336727 133126989 245377939 458441095 6 1 6 1 10 8 7 5 13 411587362 20055619 944544311 407...
output:
3952406485
result:
ok 1 number(s): "3952406485"
Test #7:
score: 0
Accepted
time: 2ms
memory: 5696kb
input:
20 5 14 6 4 8 9 9 19 9 4 3 11 1 1 2 7 15 10 10 12 4 4 4 18 3 6 13 6 6 8 9 8 10 10 15 11 5 5 13 7 17 5 4 2 13 3 7 16 10 18 19 3 2 20 10 14 16 1 7 7 606342615 488095819 750709960 33584439 771900187 698730493 948263895 3 6 5 8 2 3 5 8 19 101211247 561341909 632560117 131386047 492765331 974906960 19473...
output:
4189123945
result:
ok 1 number(s): "4189123945"
Test #8:
score: 0
Accepted
time: 1ms
memory: 5564kb
input:
20 5 4 7 3 10 7 7 19 3 8 8 13 7 9 5 10 20 15 4 6 9 8 17 18 4 14 18 4 11 19 6 16 2 9 12 11 1 8 4 8 12 13 5 3 17 6 1 2 4 6 14 2 5 20 5 16 15 7 1 13 95752893 3 2 19 892426597 327440029 2 1 3 16 373964086 440684880 794548330 10 9 4 7 1 260398237 831170126 371699840 545715811 623399817 435135695 35895477...
output:
1689583605
result:
ok 1 number(s): "1689583605"
Test #9:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
20 10 16 7 9 4 20 3 12 9 4 1 5 2 6 15 10 2 14 4 3 16 4 18 13 10 6 4 8 8 17 1 5 13 7 11 3 10 10 17 5 14 19 2 18 12 1 20 7 6 8 19 1 11 9 5 15 2 8 2 12 447579932 415823921 2 7 1 8 481020189 7 1 7 49098798 4 3 13 426920003 385468444 121065399 5 6 5 1 6 624625041 9 1 16 819581038 8 7 3 455617939 50450047...
output:
4327330411
result:
ok 1 number(s): "4327330411"
Test #10:
score: 0
Accepted
time: 1ms
memory: 5624kb
input:
20 5 19 3 2 16 10 7 11 17 9 17 19 7 5 8 10 2 13 3 9 7 2 6 16 6 5 7 7 3 12 2 8 11 8 8 4 6 20 6 1 10 12 4 9 1 9 2 7 2 15 14 10 12 18 7 14 16 10 1 2 794175528 5 4 18 81246325 24852475 273907938 427842934 9 7 10 8 5 3 928405086 734968050 804395522 862007132 897387688 1 9 5 9 1 5 20 758472795 748648558 9...
output:
7521726099
result:
ok 1 number(s): "7521726099"
Test #11:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
20 5 19 6 6 12 13 7 15 3 4 18 1 10 7 9 6 3 1 8 5 18 4 6 5 9 2 11 9 17 13 9 1 4 1 12 7 2 13 20 7 16 13 1 14 17 5 5 2 7 8 13 8 10 5 6 1 20 3 1 13 292321203 10 13 6 548236428 244292361 250056418 727739990 264224921 725054278 910541276 221145051 127677552 758446913 385535406 762575958 207120198 4 1 1 3 ...
output:
8832394712
result:
ok 1 number(s): "8832394712"
Test #12:
score: 0
Accepted
time: 1ms
memory: 5600kb
input:
20 5 10 5 10 13 10 2 2 1 10 2 13 7 19 3 6 8 7 1 4 6 5 13 16 5 6 11 10 18 12 3 7 13 6 1 15 10 14 7 6 6 10 6 19 5 8 9 13 7 20 15 2 19 18 2 17 9 5 4 2 52150511 146171157 316000307 495453740 1 2 5 2 1 1 68842855 6 5 1 31877901 224409332 283120158 309031897 333612271 8 10 8 10 2 4 6 59166243 357101515 77...
output:
2201101469
result:
ok 1 number(s): "2201101469"
Test #13:
score: 0
Accepted
time: 90ms
memory: 25104kb
input:
200000 1000 3869 179271 254847 43406 189114 413273 80717 5718 611431 57895 157647 882111 186703 24373 946202 118355 39746 300097 136064 149508 656766 35740 55618 652588 50125 198352 717065 76522 187827 242196 134016 100100 727264 114259 74612 80378 113779 17324 364222 119496 5566 841672 121801 11873...
output:
2836039365287
result:
ok 1 number(s): "2836039365287"
Test #14:
score: 0
Accepted
time: 131ms
memory: 65628kb
input:
200000 1000 110655 107480 590984 132612 12294 464859 69352 113029 610869 44858 136789 212652 136607 18741 260038 167228 179415 24876 26607 32035 79887 134245 156560 83889 109493 152264 15069 132602 100024 770532 119577 119395 331013 171874 171712 193893 106432 85115 862891 93176 107222 476895 197237...
output:
64992256868707
result:
ok 1 number(s): "64992256868707"
Test #15:
score: 0
Accepted
time: 132ms
memory: 41096kb
input:
200000 1000 5646 139976 888233 194063 133382 838729 3528 149944 935567 179273 99862 106223 187539 71975 505463 136585 129505 935273 82507 68026 595441 75751 48849 502554 93933 91832 987481 103300 145976 330667 48032 88998 798383 32418 179169 848135 196045 69692 837269 106551 192683 659852 86324 1028...
output:
33080003296367
result:
ok 1 number(s): "33080003296367"
Test #16:
score: 0
Accepted
time: 107ms
memory: 27028kb
input:
200000 1000 100789 143247 951596 184905 127836 315585 39946 82707 850355 169294 117009 411330 132650 64966 879243 102215 2263 796022 199188 16034 125285 175541 184406 794426 44993 56803 110828 89088 186451 25094 95154 174724 661668 190605 186398 628475 170720 168944 621331 37887 20489 504324 119085 ...
output:
10313141468484
result:
ok 1 number(s): "10313141468484"
Test #17:
score: 0
Accepted
time: 117ms
memory: 28472kb
input:
200000 1000 7187 147473 702921 84465 125780 379656 65828 193826 166048 6121 107162 69812 112878 189480 155162 175065 181415 457439 4928 95678 570664 130585 198721 735684 85654 125733 957438 168661 128258 405660 9714 148244 49029 28050 170125 415590 182198 140775 81431 29349 31937 91794 81014 43143 7...
output:
41639679876366
result:
ok 1 number(s): "41639679876366"
Test #18:
score: 0
Accepted
time: 108ms
memory: 44040kb
input:
200000 1000 38137 48633 577589 85472 111806 878509 115825 142395 528980 88385 38757 134592 96362 162141 282857 142395 154526 567634 140611 96148 348238 152585 151549 860327 196638 187515 16665 89100 142395 538110 123609 22322 589772 142460 153717 235024 7867 60756 146698 142395 132746 398285 199472 ...
output:
1167343829680
result:
ok 1 number(s): "1167343829680"
Test #19:
score: 0
Accepted
time: 104ms
memory: 24924kb
input:
200000 100 27827 103378 362667 106016 100737 685209 180741 138962 848831 182602 178842 615618 45331 154542 7467 125339 62976 401343 47664 139224 511036 52317 95635 576295 166065 38820 623872 39232 3551 48285 68268 62162 811766 24705 96354 802641 1155 164945 983372 184788 185480 318268 76729 182944 6...
output:
3278197882342
result:
ok 1 number(s): "3278197882342"
Test #20:
score: 0
Accepted
time: 111ms
memory: 30628kb
input:
200000 10000 161412 78399 410741 60581 22108 470946 166354 101977 598140 9264 124306 801385 55943 89375 61708 119391 141069 844096 69646 130554 495450 18709 3004 735351 105029 92317 623745 51986 181728 709047 18465 68443 459430 137665 41646 139451 195115 120487 185079 145631 89870 441139 133972 1135...
output:
28259391992508
result:
ok 1 number(s): "28259391992508"
Test #21:
score: 0
Accepted
time: 93ms
memory: 26936kb
input:
200000 1000 118663 76400 511116954 152090 177381 126231014 172263 81810 413056307 163288 184043 785238121 128196 60132 482390615 35317 66895 625816766 73325 128172 174530041 131745 189662 867562479 10113 66870 379532285 66020 91003 229115708 102762 44502 879092254 13031 153858 757888534 191239 10785...
output:
2689964237475
result:
ok 1 number(s): "2689964237475"
Test #22:
score: 0
Accepted
time: 98ms
memory: 28612kb
input:
200000 1000 29077 126386 649980344 143653 104575 267233088 183425 115711 69828010 175786 77376 685486618 157499 22867 32409621 6419 159123 513025616 127406 82180 698112418 180282 165103 55379793 128940 29540 249239831 113235 129783 467825570 19563 12175 318709160 111705 59238 775295675 21829 5249 54...
output:
9701821272296
result:
ok 1 number(s): "9701821272296"
Test #23:
score: 0
Accepted
time: 96ms
memory: 22700kb
input:
200000 100 29849 49842 197624418 161777 109394 885234133 75975 82402 633232587 89404 166808 533783001 49596 88614 985713847 24529 158554 772335200 11186 147718 763006774 197165 53858 762323591 68456 61551 861196020 108414 151582 820187692 154901 185079 306163454 158226 413 21072105 63592 187399 1386...
output:
3432880748421
result:
ok 1 number(s): "3432880748421"
Test #24:
score: 0
Accepted
time: 54ms
memory: 18544kb
input:
10000 100000 695 3489 40825 808 3031 346928 407 1767 217060 517 5144 999817 732 3775 64823 9015 3680 814871 2577 2166 678833 4561 2194 781076 2192 2809 581026 8321 5737 410256 9711 1185 232845 9278 5326 141703 4972 3504 95843 8889 4036 676473 5549 3920 802002 5571 4879 751801 7796 3 34259 9150 8811 ...
output:
344074365717
result:
ok 1 number(s): "344074365717"
Test #25:
score: 0
Accepted
time: 51ms
memory: 16056kb
input:
10000 100000 4613 5099 139578 6625 5616 438422 2847 9861 322830 5468 9649 673381 5659 108 473713 1094 2605 521608 9673 9837 59919 8727 8688 318646 745 240 394796 2201 4771 470553 2422 2861 543530 6338 9537 300936 7802 7233 154098 6836 9414 577425 5786 9850 721496 1593 813 454736 5822 2496 595616 917...
output:
262635309824
result:
ok 1 number(s): "262635309824"
Test #26:
score: 0
Accepted
time: 47ms
memory: 17832kb
input:
10000 100000 7247 8650 349847 3346 9268 266262 4472 2343 454547 3405 9102 927521 7586 4645 730664 9993 3235 306579 6668 6657 423328 3955 8143 932663 9005 3698 730427 4095 3555 677540 8503 1297 146836 2263 8865 121112 263 1905 146753 5171 6814 167459 9013 7920 258198 5129 571 189219 4840 4529 239682 ...
output:
276831698444
result:
ok 1 number(s): "276831698444"
Test #27:
score: 0
Accepted
time: 165ms
memory: 57956kb
input:
200000 100000 106140 199990 396982 184648 8575 697744 68995 44133 948138 136282 8575 747470 124620 43625 317314 103347 31552 162501 59994 173031 414509 8575 12061 52521 124823 194413 306045 85927 8575 716348 36403 158968 346040 130233 120259 341395 65028 104646 125505 141339 78882 456834 8575 103257...
output:
788443319573
result:
ok 1 number(s): "788443319573"
Test #28:
score: 0
Accepted
time: 25ms
memory: 8424kb
input:
10000 1000 7128 7968 325711 8677 9723 651537 4334 2231 553239 4466 8640 515840 1404 4917 865511 1878 5488 530499 4313 3784 990023 9090 7990 970591 8640 7512 251523 8428 8929 346309 1380 5804 369687 3820 922 22922 1446 4697 232376 7075 3798 447884 2676 6318 328654 2806 4721 400684 1102 6416 767003 69...
output:
7900356489
result:
ok 1 number(s): "7900356489"
Test #29:
score: 0
Accepted
time: 94ms
memory: 29180kb
input:
200000 1000 87598 38657 388689 18500 64060 808477 126220 118058 934679 97510 130778 294975 12619 53421 128435 131531 38864 859531 149730 124581 984646 41798 3709 179172 108680 113421 182953 68303 41286 159312 26071 191728 617782 110929 53311 569896 147080 135683 308477 6690 61890 90596 87915 115735 ...
output:
56527731707546
result:
ok 1 number(s): "56527731707546"
Test #30:
score: 0
Accepted
time: 151ms
memory: 65408kb
input:
200000 1000 3651 63836 620443 175291 58139 877018 127031 115082 897241 14710 11719 334844 113519 180815 365821 74067 164507 339740 130606 109599 758261 13886 13974 820662 71841 54147 675074 86224 197128 549323 75639 31775 773927 172291 24181 764140 87731 195777 815287 175088 148192 786598 51768 4864...
output:
2520920542809
result:
ok 1 number(s): "2520920542809"
Test #31:
score: 0
Accepted
time: 139ms
memory: 41312kb
input:
200000 1000 10915 153043 103480 60121 125336 567526 25183 68938 405950 8007 178595 849057 62933 25258 509948 49799 84982 471914 125581 25412 865192 101688 99618 529823 24556 75362 505849 105682 149302 344803 130652 135381 112858 120206 84055 417957 196302 53420 565167 19461 42660 868035 45226 64644 ...
output:
2368247807264
result:
ok 1 number(s): "2368247807264"
Test #32:
score: 0
Accepted
time: 107ms
memory: 28884kb
input:
200000 1000 12170 4068 679924 39189 30774 520805 192664 38691 468918 64014 89141 601310 70056 185184 750732 65104 193406 509110 162936 17231 529552 84743 73767 816544 124600 186058 538504 117567 17408 695549 83149 137367 488270 60743 41849 921866 147180 125670 667937 141106 195565 380423 32361 19854...
output:
10936498220312
result:
ok 1 number(s): "10936498220312"
Test #33:
score: 0
Accepted
time: 112ms
memory: 26972kb
input:
200000 1000 22368 196974 633703 49791 20259 575951 129914 47754 33031 183673 177279 989241 70863 23001 196032 33116 178956 543751 198980 191949 795942 55682 108032 455014 35454 43714 82763 120379 66660 490851 30599 32064 403891 124724 64072 99211 27130 2631 485328 187062 10046 201561 130116 106980 2...
output:
24235920714521
result:
ok 1 number(s): "24235920714521"
Test #34:
score: 0
Accepted
time: 133ms
memory: 45484kb
input:
200000 1000 116046 86759 428103 172409 79124 523139 133983 174910 684081 120846 159562 101748 159562 176935 784089 118607 159562 231343 181901 123128 122331 23812 170688 78927 92516 159562 900878 159562 158726 540905 22288 181262 402757 89534 159562 175354 92345 159562 958628 184107 112365 376908 11...
output:
724973102849
result:
ok 1 number(s): "724973102849"
Test #35:
score: 0
Accepted
time: 107ms
memory: 24396kb
input:
200000 100 19321 126387 489536 143888 72329 352097 30894 20064 712230 131175 136986 556023 157321 23072 315938 94593 15830 622612 139825 155740 233453 5788 102488 92342 184775 10653 352969 49303 38959 216396 133503 104683 883672 157623 34890 201330 79879 91637 789513 143328 83608 551932 21346 35694 ...
output:
27003662800059
result:
ok 1 number(s): "27003662800059"
Test #36:
score: 0
Accepted
time: 105ms
memory: 31620kb
input:
200000 10000 3892 79172 103904 5446 7820 250665 91108 38167 853453 103772 10525 916698 78949 54926 421611 11451 64900 862139 166797 43080 137700 51724 54018 604317 77112 31810 805372 56130 64219 336432 115941 82512 603629 65320 122976 305966 77648 180169 175809 104771 192297 952420 12347 157466 5180...
output:
4500406673450
result:
ok 1 number(s): "4500406673450"
Test #37:
score: 0
Accepted
time: 105ms
memory: 28904kb
input:
200000 1000 181124 52288 628181229 81260 68338 460129571 104673 149090 885436197 2142 112891 371042265 80478 179322 513367307 95438 15587 131076227 30778 8456 501625639 160903 66673 871700923 12168 22841 170566096 126673 23812 984522612 26942 161682 913733444 130487 73280 984763548 84554 16639 90834...
output:
52866553446837
result:
ok 1 number(s): "52866553446837"
Test #38:
score: 0
Accepted
time: 103ms
memory: 29328kb
input:
200000 1000 175020 169862 793479280 156086 172053 947954091 13843 3165 487878509 11852 19236 99624353 123412 84730 122172906 15107 197126 979588642 58154 2414 283402144 191633 142839 884191619 153394 93260 808623295 152420 163270 241846367 10567 43374 802486643 141757 43643 83713134 115793 138317 39...
output:
13365926344897
result:
ok 1 number(s): "13365926344897"
Test #39:
score: 0
Accepted
time: 96ms
memory: 24452kb
input:
200000 100 191037 152865 263600139 26751 57316 559352197 146682 169810 483701428 8541 136749 82206575 42504 3557 316356752 199488 40850 896343927 26962 131234 372680708 129769 175416 418044528 147600 130971 859624400 131802 98361 564302498 170913 25869 947459963 19704 36656 439860007 15226 60658 898...
output:
16969809124829
result:
ok 1 number(s): "16969809124829"
Test #40:
score: 0
Accepted
time: 61ms
memory: 18004kb
input:
10000 100000 4580 1497 316900 814 8742 524441 1410 4655 23519 3977 3638 841887 2390 7434 476524 5731 9881 187716 2450 2291 978396 5563 3129 870209 3124 6988 874283 3509 7541 333447 2741 9976 690969 4045 5450 678585 5653 8489 757667 7188 7708 690147 1795 3546 420822 3679 3133 205950 4505 5519 775852 ...
output:
4836577988659
result:
ok 1 number(s): "4836577988659"
Test #41:
score: 0
Accepted
time: 59ms
memory: 19100kb
input:
10000 100000 4653 3706 523972 939 7337 234766 3084 4264 97621 8929 8305 505355 9784 364 189666 5852 8351 864066 9921 5019 891463 6900 3334 710006 2744 6055 348504 2565 7873 980024 3739 2718 126636 1630 3148 942220 7683 1267 823725 7817 4946 221435 8263 1999 529065 1853 8265 541901 133 5145 700356 73...
output:
5220539670971
result:
ok 1 number(s): "5220539670971"
Test #42:
score: 0
Accepted
time: 44ms
memory: 18380kb
input:
10000 100000 4241 4166 652711 748 8258 369532 5098 3033 90023 4976 7437 202687 2845 7604 209038 6908 2814 645669 4358 5037 875529 6108 2928 917090 636 5304 199450 2143 1861 232122 4162 8680 836006 5092 4755 23742 1960 5486 538266 1967 7057 284260 6051 4040 319323 5357 1659 71541 3052 8681 898285 556...
output:
1203129899912
result:
ok 1 number(s): "1203129899912"
Test #43:
score: 0
Accepted
time: 166ms
memory: 58732kb
input:
200000 100000 181504 121792 724882 131625 175901 49774 159561 131625 20815 137745 121760 859930 26785 68889 632144 35429 103942 865961 107928 55095 672993 67039 97861 179431 131625 21837 315022 114465 155299 64356 131625 126594 246783 23865 131625 684375 131625 178351 737769 65537 52243 740198 64045...
output:
2033108027017
result:
ok 1 number(s): "2033108027017"
Test #44:
score: 0
Accepted
time: 28ms
memory: 10508kb
input:
10000 1000 9125 1036 733259 7032 9698 51518 1806 7793 23293 9202 6200 866247 557 347 551479 530 1710 310982 4247 5941 451854 8087 3332 63240 5415 7319 766338 5922 7684 678930 8972 6881 768053 8057 170 408091 5949 766 216458 4010 3884 686299 9668 6819 178977 5563 8438 510584 9636 4810 368829 9499 109...
output:
9507506833110
result:
ok 1 number(s): "9507506833110"
Test #45:
score: 0
Accepted
time: 88ms
memory: 28820kb
input:
200000 1000 71176 21183 730330 160324 172021 897073 151830 32299 224410 169386 91085 748872 106519 26075 289759 158543 44176 378889 178272 19536 739700 160819 123445 589949 195542 58187 154047 59477 199974 474299 46749 30515 427678 153908 186741 688998 76127 27233 890473 27310 32097 163850 193555 22...
output:
38186668141662
result:
ok 1 number(s): "38186668141662"
Test #46:
score: 0
Accepted
time: 153ms
memory: 65336kb
input:
200000 1000 1037 134194 706127 131670 102492 932084 15112 78150 89872 109087 95479 182923 25754 12018 447982 56719 99997 967856 129740 78419 828980 91949 150874 445017 88422 97966 10142 90605 190541 980522 105931 149165 114538 79097 183719 676941 185156 3665 821753 181022 132665 782876 54315 72712 3...
output:
1333189909181
result:
ok 1 number(s): "1333189909181"
Test #47:
score: 0
Accepted
time: 127ms
memory: 41520kb
input:
200000 1000 169218 103542 502021 134049 63058 830039 136279 157370 32 106312 139470 583916 81356 169511 947006 105046 107526 741953 131388 150452 995760 82498 18091 743505 63228 37258 33971 81456 188953 969117 6300 156087 281006 160255 75051 272714 36234 175330 835612 27863 93420 474673 168219 36584...
output:
1349199193687
result:
ok 1 number(s): "1349199193687"
Test #48:
score: 0
Accepted
time: 117ms
memory: 28920kb
input:
200000 1000 195206 118953 843293 2266 78702 153488 45480 78890 713876 132094 182473 964469 193356 112509 505892 80377 33913 611479 49320 25125 354225 41445 98714 390033 79699 16879 255377 108257 72370 531403 77807 12165 827150 130287 15217 489872 123990 194974 641908 85139 91657 775763 75871 62952 4...
output:
3090916089461
result:
ok 1 number(s): "3090916089461"
Test #49:
score: 0
Accepted
time: 112ms
memory: 28600kb
input:
200000 1000 9405 4680 978431 54496 125462 318786 126250 140235 222498 95127 193358 77394 109211 110390 269747 91922 112566 752302 123250 193223 397166 14469 98708 799064 52998 72131 616221 50553 107502 737206 127913 106395 758725 155073 70299 177526 173270 66097 66381 9104 19385 71629 160207 141911 ...
output:
9308193282829
result:
ok 1 number(s): "9308193282829"
Test #50:
score: 0
Accepted
time: 127ms
memory: 47100kb
input:
200000 1000 1302 119118 727934 54703 160883 370198 1302 144485 593178 99831 69443 681305 1302 59848 420636 65555 142001 241843 152838 131202 248435 63938 139588 853636 143961 1302 605961 54003 26139 504026 101529 31499 201457 1302 15752 559613 57703 143474 994828 1302 145965 777923 172428 1302 51459...
output:
852295398100
result:
ok 1 number(s): "852295398100"
Test #51:
score: 0
Accepted
time: 104ms
memory: 26548kb
input:
200000 100 136715 189105 194451 97544 164177 430243 120131 122135 102272 93228 166114 92394 151317 171412 995651 95041 162931 401879 78716 178746 684325 128978 146720 463985 18550 42188 739320 189289 51713 151880 50681 57319 696921 89526 79129 385566 186479 189118 652751 133683 140620 881486 45002 1...
output:
16531152597000
result:
ok 1 number(s): "16531152597000"
Test #52:
score: 0
Accepted
time: 102ms
memory: 32152kb
input:
200000 10000 95646 129789 619818 25591 91374 131024 185536 188983 805511 49975 30787 746206 156556 64845 558640 30842 137948 833841 86404 189967 530674 138291 23868 499382 83836 155136 573045 124220 57408 461884 32671 117169 759504 189577 55671 720012 97289 133266 963920 64146 133058 196957 122972 6...
output:
893686720053
result:
ok 1 number(s): "893686720053"
Test #53:
score: 0
Accepted
time: 93ms
memory: 26728kb
input:
200000 1000 42755 56603 877044730 124149 179588 227731515 108753 137966 795698082 120931 38478 917240755 136397 92279 275547278 127094 40906 51846687 185113 164515 365334627 166235 82060 828950932 127097 169516 147447544 170547 47779 664566767 134746 84196 123224218 132693 182757 521180670 104981 17...
output:
32753057222724
result:
ok 1 number(s): "32753057222724"
Test #54:
score: 0
Accepted
time: 111ms
memory: 29220kb
input:
200000 1000 38978 157481 6713417 170124 57179 211694022 62386 189537 598731037 155769 150137 93594636 130861 135405 810671994 98436 20923 338444444 103218 10336 949273302 55569 73363 597977222 125121 97808 860373047 151926 83529 183299099 63727 165133 209616113 89466 66506 115441888 73166 169695 410...
output:
7217810034397
result:
ok 1 number(s): "7217810034397"
Test #55:
score: 0
Accepted
time: 89ms
memory: 26360kb
input:
200000 100 18367 146595 457999988 16611 56600 352484959 135898 7169 131399434 160094 10148 190844481 38841 85310 31999792 15456 189516 968597572 198438 95705 244581841 14112 170115 261007148 117779 46121 893899667 122569 121263 525246442 70064 114187 766554145 100701 162893 275200 194138 96744 34992...
output:
11235706268229
result:
ok 1 number(s): "11235706268229"
Test #56:
score: 0
Accepted
time: 65ms
memory: 19232kb
input:
10000 100000 9124 3760 156945 6035 6425 830252 3986 5686 527725 4796 4486 910161 4978 9838 266743 4247 8727 309971 7120 7355 230816 1766 2294 9998 9136 6126 799455 9905 7909 977784 8240 1796 778882 4610 275 841435 8658 8591 477210 1738 1759 824047 3397 382 982551 8546 2268 825721 4937 5752 276942 31...
output:
5951910836836
result:
ok 1 number(s): "5951910836836"
Test #57:
score: 0
Accepted
time: 51ms
memory: 18912kb
input:
10000 100000 387 3141 878004 7805 5715 902464 8132 6641 318645 6286 9812 922700 9899 9800 313097 8238 1548 316575 1758 5771 634530 5685 8127 958670 5652 1868 932233 5174 3822 834289 5541 9413 690921 2560 2269 901748 7923 3423 466816 3942 9687 235103 7523 7537 4868 5822 6954 261027 1633 3940 502652 3...
output:
3637336320859
result:
ok 1 number(s): "3637336320859"
Test #58:
score: 0
Accepted
time: 57ms
memory: 18672kb
input:
10000 100000 6700 7355 62786 4672 9293 783952 2520 9561 473111 7891 7189 728763 8619 96 323150 306 1225 570523 1090 5422 316132 4487 8131 217926 9470 2005 442696 2786 4203 877871 8957 5008 909909 1991 403 251249 3237 1126 372984 3581 1462 695839 2063 9740 104499 3583 9059 217470 5743 8777 5333 7119 ...
output:
847523643979
result:
ok 1 number(s): "847523643979"
Test #59:
score: 0
Accepted
time: 181ms
memory: 58248kb
input:
200000 100000 199652 130037 105562 158586 83154 500938 175388 41047 52013 150179 196828 895596 175388 114700 309291 175388 150216 338527 183000 175388 869264 137141 149071 630573 30841 175388 977617 138835 125075 844829 137512 118500 609644 132732 175388 909842 175388 57828 873260 83073 92075 163037...
output:
3166979756899
result:
ok 1 number(s): "3166979756899"
Test #60:
score: 0
Accepted
time: 32ms
memory: 10508kb
input:
10000 1000 5809 3020 656957 2282 3569 327651 6777 8675 513928 1641 9519 452483 2883 8883 66842 6117 4266 918380 179 5982 396678 5631 4734 986898 550 4285 981587 2560 847 458577 3347 3563 714169 8076 9354 685289 5251 4855 936435 4235 8176 344076 2736 1412 2472 7296 9973 250762 497 1993 260790 5011 42...
output:
4130162772330
result:
ok 1 number(s): "4130162772330"
Test #61:
score: 0
Accepted
time: 93ms
memory: 31772kb
input:
200000 10000 108863 52545 999407425 125566 97851 613470515 151606 55538 835861395 12471 26177 565532302 151372 180015 71114721 102282 177189 695982413 1689 47962 573953932 79249 140745 881443178 190258 143013 951560349 150062 139801 743862636 157762 2962 435374756 111153 199794 830560190 121729 7584...
output:
23015852198733
result:
ok 1 number(s): "23015852198733"
Test #62:
score: 0
Accepted
time: 142ms
memory: 49184kb
input:
200000 10000 54475 79138 756040 37324 26684 514194 140940 90310 34728 114552 143543 354142 199281 79630 327612 196858 50682 487095 175013 171647 783061 72567 7104 503564 29786 58821 501171 123581 134111 379809 91910 3745 453926 51583 33327 979797 66100 120428 301481 195803 58360 200749 39615 4367 57...
output:
309038584404
result:
ok 1 number(s): "309038584404"
Test #63:
score: 0
Accepted
time: 151ms
memory: 47888kb
input:
200000 1000 46055 199496 878182 142501 64955 903559 9779 104485 609441 87160 15512 39673 185942 148821 186598 155799 42741 648266 49331 188126 954736 149902 28644 504379 193851 8133 947003 33262 36121 333179 46047 143165 752717 20336 50740 572287 171035 67775 599418 78574 52862 563403 60286 134985 3...
output:
2191048592443
result:
ok 1 number(s): "2191048592443"
Test #64:
score: 0
Accepted
time: 118ms
memory: 43592kb
input:
200000 100 120350 51763 323155 174454 103028 351658 64206 167972 177958 92312 186503 599512 38938 111280 501045 108557 91139 113017 119094 172726 722458 189050 112351 487529 190536 95559 705079 130175 95443 530937 13242 114008 84048 69736 23335 628326 72468 190242 30153 62687 113977 461016 84377 175...
output:
14316832510629
result:
ok 1 number(s): "14316832510629"
Test #65:
score: 0
Accepted
time: 28ms
memory: 9272kb
input:
10000 100 1443 3741 103614 5013 6256 262229 7390 1697 591571 5613 4788 837263 597 6403 2893 1123 9226 379487 8059 7075 280368 9952 3942 426453 485 3376 570660 8718 3422 506729 7036 4084 436996 9860 2314 549221 3259 982 821147 4552 659 843774 1490 792 162397 9875 5320 334024 8064 8155 958529 3979 731...
output:
7770688409
result:
ok 1 number(s): "7770688409"
Test #66:
score: 0
Accepted
time: 185ms
memory: 49484kb
input:
200000 200000 32133 197586 827675010 64074 171135 753623248 1362 478 760518998 88173 156807 547718040 21129 119105 426856554 143534 37397 623848929 86193 124510 872503943 45686 73567 251582562 111936 194527 323918358 25130 10053 221224759 11927 50555 421271383 100878 83425 594068735 159628 36107 973...
output:
54824453133305
result:
ok 1 number(s): "54824453133305"
Extra Test:
score: 0
Extra Test Passed