QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#426480 | #1961. Postman | Bronya | WA | 90ms | 10568kb | C++20 | 3.2kb | 2024-05-31 12:35:54 | 2024-05-31 12:35:55 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n,m,t;
struct node{
int x,id;
}a[500005];
const long long inf=8e18;
namespace Subtaskk1{
bool cmp(node x,node y){
return x.x<y.x;
}
int b[500005],cnt;
struct Heap{
priority_queue<int >q;
long long sum=0;
void Init(){
while(!q.empty())q.pop();
sum=0;
}
void Insert(int x){q.push(-x);}
void add(){sum+=-q.top();q.pop();}
}H;
long long calc(){
sort(a+1,a+1+n,cmp);
int now=0,W=m;
while(now<n&&a[now+1].x<0)now++;
if(now==n||W==n)return inf;
long long sum=a[n].x;
if(a[1].x<0){
sum+=2*(-a[1].x);
if(!W)return inf;
}
W-=min(W,now);cnt=0;
for(int i=now+2;i<=n;i++)b[++cnt]=a[i].x-a[i-1].x;
if(cnt<W)return inf;
H.Init();
long long mi=0,Bronya=0;
for(int i=1;i<=cnt;i++)
if(i<=cnt-W)H.Insert(b[i]);
else Bronya+=b[i];
mi=Bronya;
for(int i=cnt-W+1;i<=n;i++){
H.Insert(b[i]);H.add();Bronya-=b[i];
mi=min(mi,Bronya+2*H.sum);
}
// cerr<<mi<<" "<<sum<<endl;
return mi+sum;
}
void Solve(){
long long ans=calc();
m=n-m;
for(int i=1;i<=n;i++)a[i].x=-a[i].x;
ans=min(ans,calc());
if(ans==inf)puts("-1");
else printf("%lld\n",ans);
}
}
namespace Subtaskk2{
bool cmp(node x,node y){
return x.x<y.x;
}
int b[500005],cnt;
void Solve(){
if(a[n].x<0){
for(int i=1;i<=n;i++)a[i].x=-a[i].x;
m=n-m;
}
sort(a,a+1+n,cmp);
int L=0,R=0;
for(int i=0;i<=n;i++){
if(a[i].id==0)L=i;
if(a[i].id==n)R=i;
}
int W=m;
if(W==n)puts("-1");
else if(W==0){
if(R==n&&L==0)printf("%lld\n",(long long)a[n].x);
else puts("-1");
}
else if(W==1){
if(L==0&&R==n){
int mi=2e9;
for(int i=2;i<=n;i++)mi=min(mi,a[i].x-a[i-1].x);
printf("%lld\n",mi+a[n].x);
}
else if(L==0)printf("%lld\n",(long long)a[n].x-a[R].x+a[n].x);
else if(R==n)printf("%lld\n",-a[0].x+(a[n].x-a[0].x));
else printf("%lld\n",2ll*(a[n].x-a[0].x)+a[R].x);
}
else if(W==n-1){
if(L+1!=R)puts("-1");
else printf("%lld\n",2ll*(a[n].x-a[0].x)-a[R].x);
}
else {
W-=min(W,L+n-R);
for(int i=L+2;i<R;i++)b[++cnt]=a[i].x-a[i-1].x;
sort(b+1,b+1+cnt);
long long ans=2ll*(-a[0].x+a[n].x-a[R].x)+a[R].x;
// cerr<<ans<<" "<<-a[0].x<<" "<<a[n].x<<" "<<a[R].x<<endl;
for(int i=1;i<=W;i++)ans+=2*b[i];
printf("%lld\n",ans);
}
}
}
int main(){
// freopen("postman.in","r",stdin);
// freopen("postman.out","w",stdout);
scanf("%d%d%d",&n,&m,&t);
for(int i=1;i<=n;i++)scanf("%d",&a[i].x),a[i].id=i;
if(t==1)Subtaskk1::Solve();
else if(t==2)Subtaskk2::Solve();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 7972kb
input:
100 0 1 751 558 131 292 317 886 785 847 224 668 649 358 725 250 953 65 176 733 461 84 114 977 628 673 798 863 373 827 51 630 518 347 527 876 366 241 452 670 813 314 846 342 357 460 985 581 841 843 282 907 327 656 411 944 421 99 441 388 568 763 167 351 793 916 517 109 999 390 272 639 513 534 304 253 ...
output:
999
result:
ok single line: '999'
Test #2:
score: 0
Accepted
time: 1ms
memory: 8076kb
input:
100 50 1 654 349 533 94 619 754 498 939 469 518 3 661 431 214 195 198 989 548 561 312 262 629 807 981 624 639 178 765 706 782 888 611 553 363 336 91 176 485 735 791 596 455 390 760 995 202 417 82 798 883 209 155 725 908 789 56 49 899 231 423 815 228 314 400 748 946 736 840 385 446 938 284 10 917 593...
output:
1397
result:
ok single line: '1397'
Test #3:
score: 0
Accepted
time: 1ms
memory: 8008kb
input:
100 99 1 266 337 80 671 358 778 217 288 219 48 863 19 137 987 602 415 155 398 753 956 210 317 94 303 997 192 123 442 666 959 685 71 34 588 615 214 327 881 582 51 646 630 291 354 749 108 984 308 813 182 384 699 114 692 611 296 590 432 103 240 341 465 969 370 771 914 250 656 742 708 174 323 939 493 17...
output:
1986
result:
ok single line: '1986'
Test #4:
score: 0
Accepted
time: 1ms
memory: 7764kb
input:
100 100 1 713 172 634 763 181 502 78 995 598 751 792 961 585 335 952 343 375 627 651 515 856 121 743 931 18 492 726 517 136 143 314 993 80 29 283 427 248 274 114 200 535 94 174 782 818 90 806 88 104 808 910 892 791 462 304 676 67 973 901 891 705 567 475 444 949 846 299 735 233 914 803 27 810 210 396...
output:
-1
result:
ok single line: '-1'
Test #5:
score: 0
Accepted
time: 0ms
memory: 7828kb
input:
100 0 1 -102 -827 -638 -660 -604 -258 -692 -237 -927 -371 -129 -908 -830 -229 -585 -364 -103 -58 -975 -153 -563 -17 -201 -443 -56 -560 -606 -45 -891 -331 -349 -420 -266 -219 -482 -716 -51 -723 -876 -211 -121 -63 -814 -239 -937 -541 -74 -69 -334 -42 -227 -479 -571 -137 -913 -885 -525 -475 -930 -405 -...
output:
-1
result:
ok single line: '-1'
Test #6:
score: 0
Accepted
time: 1ms
memory: 5892kb
input:
100 1 1 -747 -27 -215 -283 -833 -584 -531 -295 -636 -725 -100 -506 -108 -426 -574 -305 -919 -207 -540 -770 -264 -67 -388 -444 -77 -778 -474 -957 -706 -467 -438 -245 -240 -228 -40 -523 -803 -669 -198 -11 -740 -911 -990 -604 -236 -628 -864 -897 -440 -789 -874 -941 -153 -1 -52 -345 -819 -480 -731 -612 ...
output:
1979
result:
ok single line: '1979'
Test #7:
score: 0
Accepted
time: 1ms
memory: 8024kb
input:
100 50 1 -220 -474 -778 -792 -88 -62 -252 -742 -147 -2 -119 -575 -583 -434 -753 -425 -427 -266 -419 -344 -44 -470 -79 -28 -38 -621 -506 -821 -363 -423 -960 -272 -608 -728 -482 -392 -194 -958 -395 -712 -97 -867 -34 -499 -101 -777 -895 -200 -269 -528 -283 -972 -157 -378 -561 -90 -359 -439 -412 -72 -87...
output:
1433
result:
ok single line: '1433'
Test #8:
score: 0
Accepted
time: 0ms
memory: 8028kb
input:
100 100 1 -100 -438 -107 -887 -504 -162 -557 -696 -551 -955 -634 -230 -109 -3 -754 -669 -775 -685 -517 -137 -80 -419 -207 -131 -554 -26 -864 -981 -282 -925 -704 -457 -186 -975 -730 -174 -294 -176 -664 -385 -625 -894 -93 -156 -737 -541 -265 -906 -403 -445 -41 -260 -609 -828 -60 -800 -750 -6 -239 -846...
output:
981
result:
ok single line: '981'
Test #9:
score: 0
Accepted
time: 70ms
memory: 8712kb
input:
300000 299900 1 975494913 919276412 971822415 306295652 981185393 751782065 954706942 908207836 981200361 32580760 933121007 333012429 165323270 996792016 391102892 389040132 322687143 812406210 317257318 897931477 984765477 903680189 380567163 385513860 359332788 768879270 959852716 843574823 40665...
output:
2999995655
result:
ok single line: '2999995655'
Test #10:
score: 0
Accepted
time: 70ms
memory: 10428kb
input:
300000 299998 1 909963807 988052984 968956733 -4808472 902213296 920535913 892118351 827900769 961754681 767948569 999500834 260018295 349443084 916399438 810195269 870433267 998221337 976774994 721697345 309230801 868119413 986186795 839916169 968333430 270886226 972109273 970633299 744019611 94687...
output:
2999982764
result:
ok single line: '2999982764'
Test #11:
score: 0
Accepted
time: 88ms
memory: 10568kb
input:
300000 199998 1 760358089 791244679 984736604 275806750 247939634 978615072 302237434 991049550 934591187 382618436 230786914 789192758 236573159 396652403 855918715 877242673 984062779 458214751 395632321 988479643 399571663 377064418 969391408 796094553 999200405 268953105 991121067 941437116 8161...
output:
2999990891
result:
ok single line: '2999990891'
Test #12:
score: 0
Accepted
time: 83ms
memory: 10340kb
input:
300000 159999 1 942199382 341392725 348398313 975348962 960975251 991959712 53847869 626494403 440799630 834310895 400767959 364210160 292487754 970542288 975196994 411308866 985283714 134051724 395718459 725662488 484999687 920311363 991679253 970656922 988945259 265707789 986990069 925538439 21784...
output:
2999991601
result:
ok single line: '2999991601'
Test #13:
score: 0
Accepted
time: 83ms
memory: 10396kb
input:
300000 19999 1 816144624 978397453 440665138 283612424 945098204 339820332 885340682 313718676 922094581 381702751 471032137 872210762 240663640 985886109 780872483 996469198 325835675 968745840 794294823 121382252 948969054 880827421 977238043 126375169 950327749 994803525 201684720 219097101 41030...
output:
2999973677
result:
ok single line: '2999973677'
Test #14:
score: 0
Accepted
time: 70ms
memory: 10516kb
input:
300000 100 1 -989312886 26761301 -985728917 -391478114 -78077877 -953591083 -952597776 -966592009 -374175692 -972714759 -865102046 -253636908 -864766148 -877082592 -985097949 -955548975 -946513709 -939137884 -856158829 -878136428 -845660452 -236979816 -198429617 -194522362 -881227475 -934250481 -955...
output:
2999995006
result:
ok single line: '2999995006'
Test #15:
score: 0
Accepted
time: 76ms
memory: 10400kb
input:
300000 2 1 -204526971 -679003931 -270259823 -998170158 -517990818 -331521849 -806999125 -884402567 -394558999 -938154172 -881759024 -205775904 -989396335 -323846513 -902520693 -105353949 -989729701 -999109123 -958206886 -306635474 -650621491 -980044442 -238027623 -916877077 -987985082 -888733152 -92...
output:
2999989700
result:
ok single line: '2999989700'
Test #16:
score: 0
Accepted
time: 90ms
memory: 10512kb
input:
300000 100002 1 -982563248 -884271825 -991717692 -66746774 -387604370 -989101502 -921822473 -452835479 -343905539 -982352212 -334927349 -951113204 -975955017 -816967163 -951729538 -694131066 -367658474 -933012591 -276245389 -456156314 -309453648 -818983958 -832001600 -247724435 -401778387 -287758829...
output:
2999985866
result:
ok single line: '2999985866'
Test #17:
score: 0
Accepted
time: 82ms
memory: 10364kb
input:
300000 140001 1 -981316007 -209123045 -183025883 -382483756 -958956835 -981127429 -996221336 -953952589 -904879391 -283899126 -828187571 -206037038 -961803343 -987393716 -953516223 -348983568 -927817660 281748110 -999551602 -96518828 -400608671 31532273 -872389194 -322196531 -852614563 -441246454 -2...
output:
2999993311
result:
ok single line: '2999993311'
Test #18:
score: 0
Accepted
time: 75ms
memory: 10396kb
input:
300000 280001 1 -913709302 -903985908 -940299999 -205921103 -885171614 -92135108 -977947386 -988415908 -320447615 -795241235 -999358836 -984300628 -406654796 -479470316 -415791878 -966100008 -978511377 -301932359 -356529615 -997674923 -876662022 -887931627 -435841697 -996688996 -985518116 -992611953...
output:
2999990077
result:
ok single line: '2999990077'
Test #19:
score: 0
Accepted
time: 1ms
memory: 7704kb
input:
201 0 2 813 958 277 425 585 853 243 463 433 999 890 615 984 992 363 704 962 349 822 629 44 836 3 832 214 127 816 106 560 570 693 40 934 910 310 674 508 930 995 982 761 429 329 283 602 312 190 67 29 531 847 267 480 956 225 592 466 527 343 809 206 633 364 202 951 581 808 460 940 610 821 725 745 846 12...
output:
-1
result:
ok single line: '-1'
Test #20:
score: 0
Accepted
time: 1ms
memory: 8016kb
input:
201 1 2 641 284 624 715 55 416 598 109 896 957 102 777 343 933 263 245 488 444 65 493 860 504 595 98 856 685 358 523 434 882 835 497 785 526 531 272 781 101 535 501 207 510 945 41 214 770 556 314 87 522 361 517 513 815 969 847 919 867 779 333 727 908 811 228 857 4 153 441 198 419 437 515 664 113 394...
output:
1484
result:
ok single line: '1484'
Test #21:
score: 0
Accepted
time: 0ms
memory: 8076kb
input:
201 2 2 459 848 667 178 587 393 240 592 679 43 323 670 473 484 844 988 243 40 644 657 786 870 33 521 183 523 631 696 701 572 281 306 912 886 915 961 549 538 739 941 706 712 820 506 881 916 266 69 860 84 54 677 945 370 773 681 733 800 312 296 50 953 671 794 356 188 190 390 831 542 433 210 398 57 874 ...
output:
1491
result:
ok single line: '1491'
Test #22:
score: 0
Accepted
time: 1ms
memory: 8008kb
input:
201 100 2 325 812 770 920 500 742 868 298 47 240 521 458 250 991 396 413 314 618 11 192 704 188 187 781 948 611 115 360 890 662 373 612 776 479 368 766 108 209 926 799 636 539 701 762 579 455 312 747 306 21 691 687 904 974 852 994 140 380 625 614 347 29 519 571 518 431 543 914 385 791 765 559 617 27...
output:
1514
result:
ok single line: '1514'
Test #23:
score: 0
Accepted
time: 1ms
memory: 8016kb
input:
201 101 2 363 662 422 678 921 302 192 43 813 948 288 849 3 993 119 59 587 56 605 729 265 42 77 281 417 160 832 717 520 150 379 705 415 106 359 759 507 820 15 523 29 826 37 392 864 140 10 997 767 633 204 498 102 467 447 370 736 439 703 685 535 963 646 928 529 33 816 68 7 566 198 831 752 896 651 593 1...
output:
1498
result:
ok single line: '1498'
Test #24:
score: 0
Accepted
time: 1ms
memory: 7952kb
input:
201 0 2 -706 735 631 -970 -867 -945 99 -987 -930 -335 -157 -610 464 -357 -27 988 501 -528 -739 774 -443 540 876 -862 26 -244 344 453 178 -437 295 -95 -812 361 360 -747 889 -842 641 811 226 -776 420 -293 519 718 518 736 -462 617 -215 836 -822 -582 -472 -239 -653 -525 -990 -836 858 -403 308 270 803 -7...
output:
-1
result:
ok single line: '-1'
Test #25:
score: 0
Accepted
time: 1ms
memory: 7944kb
input:
201 1 2 -127 -217 -571 -295 618 -626 871 253 886 -632 131 -863 785 -789 -706 111 -598 -496 -116 -246 -901 -94 -122 322 783 498 -831 247 415 -918 156 -805 94 -18 -319 671 495 -521 -407 595 782 -278 690 -719 -340 552 966 -317 -248 -408 521 217 -497 -971 465 852 798 -397 280 803 -400 -739 -604 980 790 ...
output:
2986
result:
ok single line: '2986'
Test #26:
score: 0
Accepted
time: 1ms
memory: 5848kb
input:
201 5 2 -389 505 -693 -810 804 246 -880 -847 266 145 118 361 289 -457 318 -67 522 -207 -844 343 194 -662 621 90 -253 -242 850 816 211 -824 400 -674 -214 -278 767 -137 161 -229 -917 -621 -571 539 800 -198 129 -922 112 479 724 -461 -631 967 -549 972 -12 30 711 -735 558 21 662 936 -362 -957 892 367 -21...
output:
2969
result:
ok single line: '2969'
Test #27:
score: 0
Accepted
time: 0ms
memory: 8016kb
input:
201 199 2 271 -122 -574 116 -482 942 840 138 -962 -546 800 861 -501 -552 -970 -108 -768 -288 -136 82 -861 -698 843 -177 823 814 -55 -603 -70 489 -275 -427 -401 -788 -859 -317 -904 107 -887 -250 892 -651 666 -778 -7 -210 -588 -566 -669 482 -129 263 789 -468 -110 -13 763 392 740 -274 -469 597 670 -239...
output:
4862
result:
ok single line: '4862'
Test #28:
score: 0
Accepted
time: 1ms
memory: 7972kb
input:
201 200 2 -997 881 -394 71 794 606 199 -273 -755 -579 892 -140 668 228 -271 -258 -113 -415 -25 536 -159 508 -505 767 -748 238 -642 -861 -501 -773 859 935 443 596 771 953 -727 -229 92 -465 853 -939 -963 -173 992 89 -84 220 981 615 -794 570 316 -647 141 225 -221 -267 -503 -818 -47 344 562 726 368 -657...
output:
-1
result:
ok single line: '-1'
Test #29:
score: 0
Accepted
time: 1ms
memory: 7904kb
input:
201 0 2 352 241 -342 297 -509 873 -959 660 -468 159 -436 287 331 785 -684 -723 280 -979 -554 827 -473 171 617 204 -835 790 411 114 -84 928 -908 544 284 -552 -617 -582 447 -11 -568 -536 -56 545 -128 229 417 907 533 50 -874 -920 974 -256 480 134 404 868 -480 43 875 -99 174 -292 482 -973 -223 270 751 -...
output:
-1
result:
ok single line: '-1'
Test #30:
score: 0
Accepted
time: 1ms
memory: 8020kb
input:
201 1 2 871 -413 -995 930 -970 967 -24 277 820 -722 -541 -20 219 -353 -442 -762 208 91 13 485 -479 -176 229 595 -237 -599 622 276 -928 -875 492 747 425 753 183 -511 -507 -472 -470 841 25 -828 768 420 51 -276 -865 -211 -467 -977 98 727 -415 -884 673 -277 137 443 974 -539 -316 -258 665 921 -453 951 -5...
output:
3986
result:
ok single line: '3986'
Test #31:
score: 0
Accepted
time: 1ms
memory: 7944kb
input:
201 2 2 845 500 -175 13 -87 44 -837 -841 -868 -856 706 -671 -161 746 878 248 -486 821 97 -464 221 -171 126 -702 -694 681 240 108 -455 -526 -591 -393 -482 625 627 573 353 423 -275 -270 169 -813 -150 207 -282 498 5 768 -790 -157 -872 985 970 -935 711 -220 233 320 48 185 490 -376 -627 -931 -940 887 -54...
output:
3911
result:
ok single line: '3911'
Test #32:
score: 0
Accepted
time: 1ms
memory: 7900kb
input:
201 3 2 -680 -833 -217 -231 491 -203 954 -565 693 559 -186 457 477 942 -310 -787 -573 343 66 981 461 67 -475 -39 -542 -719 -112 534 -968 -812 -550 627 643 878 -624 284 -954 -697 605 639 -158 96 673 218 521 -226 -632 88 -490 399 -689 201 -931 -249 504 835 736 580 -57 171 -529 -323 -531 -582 787 -410 ...
output:
3981
result:
ok single line: '3981'
Test #33:
score: 0
Accepted
time: 0ms
memory: 7896kb
input:
201 200 2 597 -727 946 503 409 227 859 700 512 -872 -556 -758 982 -445 -183 -974 -416 371 201 971 867 -607 217 -774 -43 -803 432 -813 -619 384 168 520 131 -96 -562 765 -782 546 -701 100 -751 -694 -535 -741 605 49 -44 -265 -53 -516 -662 775 -242 208 574 -390 -292 799 856 288 735 232 494 -580 -360 -71...
output:
3933
result:
ok single line: '3933'
Test #34:
score: 0
Accepted
time: 1ms
memory: 7956kb
input:
201 201 2 352 -630 690 -242 -6 179 -56 257 34 153 -503 925 -146 -644 -77 -36 -616 -259 388 -336 425 -271 819 198 724 846 -173 937 204 305 216 -674 637 612 343 -34 -255 610 -49 -115 236 329 859 839 -471 -321 -513 -553 -144 -750 738 396 108 470 25 -982 734 358 -936 -946 -332 -296 -582 -845 899 922 -64...
output:
-1
result:
ok single line: '-1'
Test #35:
score: 0
Accepted
time: 0ms
memory: 7972kb
input:
101 0 2 348 845 522 766 255 580 905 978 622 847 367 412 394 693 996 164 18 299 823 227 31 984 867 62 557 781 831 594 214 144 496 122 471 97 283 381 598 737 374 154 747 423 451 565 630 890 85 959 972 812 187 116 529 389 646 927 502 692 803 727 206 40 104 584 232 669 213 270 595 716 953 515 534 333 99...
output:
-1
result:
ok single line: '-1'
Test #36:
score: 0
Accepted
time: 1ms
memory: 8076kb
input:
101 1 2 473 354 885 32 24 727 884 404 686 654 6 579 774 520 551 643 581 896 943 150 883 235 236 576 400 105 790 64 206 704 298 134 736 661 320 492 255 36 112 676 598 756 28 563 141 720 361 274 388 747 926 266 628 346 949 443 671 465 480 843 381 679 876 341 580 510 63 966 998 689 955 54 327 399 307 9...
output:
1994
result:
ok single line: '1994'
Test #37:
score: 0
Accepted
time: 0ms
memory: 8084kb
input:
101 100 2 408 946 286 231 685 614 71 895 569 531 229 797 996 697 485 150 612 43 434 215 679 287 370 314 514 172 501 821 121 473 277 938 540 832 609 854 789 930 183 518 475 640 155 672 559 340 481 580 88 397 29 14 728 56 958 48 213 551 424 352 309 344 660 751 60 899 691 368 419 221 737 701 376 875 79...
output:
1985
result:
ok single line: '1985'
Test #38:
score: 0
Accepted
time: 0ms
memory: 7868kb
input:
101 101 2 241 891 700 877 527 542 410 917 425 256 829 259 201 108 384 894 648 84 780 729 626 26 174 311 881 70 110 621 264 512 42 704 145 456 676 843 251 565 428 535 981 496 539 696 93 199 203 716 335 794 671 937 180 715 702 346 454 861 615 114 393 903 481 781 75 351 772 596 125 792 563 117 370 60 5...
output:
-1
result:
ok single line: '-1'
Test #39:
score: 0
Accepted
time: 1ms
memory: 7908kb
input:
101 0 2 -58 -472 -109 -758 -97 -45 -771 -894 -495 -909 -522 -161 -518 -19 -119 -13 -750 -199 -637 -431 -313 -266 -239 -628 -304 -339 -79 -592 -51 -253 -729 -338 -768 -425 -569 -153 -695 -536 -328 -477 -908 -797 -332 -182 -875 -798 -836 -172 -574 -959 -75 -70 -449 -346 -134 -548 -792 -398 -59 -873 -4...
output:
-1
result:
ok single line: '-1'
Test #40:
score: 0
Accepted
time: 0ms
memory: 8032kb
input:
101 1 2 -388 -172 -531 -312 -165 -247 -900 -507 -325 -986 -766 -529 -527 -114 -162 -181 -662 -670 -347 -378 -365 -209 -156 -852 -792 -58 -906 -17 -656 -120 -572 -293 -21 -552 -258 -883 -123 -865 -228 -888 -161 -395 -605 -401 -845 -997 -199 -149 -727 -976 -66 -757 -80 -427 -934 -508 -331 -455 -73 -25...
output:
2127
result:
ok single line: '2127'
Test #41:
score: 0
Accepted
time: 1ms
memory: 8016kb
input:
101 100 2 -382 -31 -984 -482 -56 -519 -29 -176 -272 -140 -209 -522 -375 -685 -469 -907 -111 -503 -107 -317 -371 -637 -313 -999 -766 -15 -834 -36 -582 -894 -636 -185 -742 -263 -355 -961 -400 -577 -952 -916 -408 -757 -191 -1 -962 -279 -154 -979 -48 -502 -25 -935 -46 -286 -776 -114 -797 -592 -840 -779 ...
output:
2865
result:
ok single line: '2865'
Test #42:
score: 0
Accepted
time: 1ms
memory: 7952kb
input:
101 101 2 -781 -386 -847 -660 -212 -769 -305 -858 -262 -369 -833 -282 -1 -981 -255 -761 -986 -841 -526 -768 -104 -938 -184 -936 -904 -872 -315 -173 -824 -227 -635 -715 -492 -779 -886 -270 -990 -166 -265 -751 -913 -497 -94 -609 -474 -714 -550 -563 -499 -90 -695 -345 -692 -947 -42 -597 -801 -435 -951 ...
output:
-1
result:
ok single line: '-1'
Test #43:
score: 0
Accepted
time: 1ms
memory: 7896kb
input:
101 0 2 686 254 895 481 784 384 327 669 722 242 837 813 241 129 774 918 799 909 778 976 155 924 232 509 114 741 528 294 649 494 483 12 230 221 657 404 469 265 888 807 564 321 546 650 283 185 936 960 344 950 396 697 970 144 489 36 983 877 184 177 615 7 496 633 280 591 549 752 215 456 501 262 517 247 ...
output:
989
result:
ok single line: '989'
Test #44:
score: -100
Wrong Answer
time: 0ms
memory: 7952kb
input:
101 1 2 287 48 373 406 178 715 686 234 303 919 357 877 114 398 219 802 201 653 469 740 927 76 776 414 744 990 635 553 940 144 132 259 764 536 959 865 438 153 210 529 619 401 693 647 666 463 677 767 615 700 361 941 627 148 542 384 756 157 981 857 743 545 465 323 942 416 491 610 430 238 567 89 439 558...
output:
999
result:
wrong answer 1st lines differ - expected: '1000', found: '999'