QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#38238 | #836. Farm of Monsters | zshccc | WA | 114ms | 14424kb | C++ | 1.9kb | 2022-07-04 20:08:04 | 2022-07-04 20:08:04 |
Judging History
answer
// 可反悔贪心
// 可以不操作,
//(h-ra)%b <a
// r=h%b
// 要砍r+1
// 对手h-ra/b= h/b+1
// rem=1;冗余步数
// 可以和op一块看,
// 也可以从冗余步数来砍
// 不然就放弃一个(用堆维护),放弃返回冗余步数最多的
// 正确性:最多加1,,失败,前面无论如何都不行,因为前面已经最大化了冗余步数
// --h,使得<0死亡
//
//
//
//
#include<bits/stdc++.h>
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define ll long long
#define debug(x) cout<<#x<<" "<<x
#define debugn(x) cout<<#x<<" "<<x<<endl
#define SZ(a) ((int)(a.size()))
#define rep(i,a,b) for(int i=a;i<b;i++)
#define mp make_pair
#define int ll
using namespace std;
const int N=3e5+10;
int num[N];
priority_queue<int>heap;
pii mons[N];
signed main(){
int n,a,b;
cin>>n>>a>>b;
for(int i=1;i<=n;i++){
cin>>num[i];
// num[i]/b,num[i]%b;
mons[i].fi=(num[i]-1)/b,//撑多少次不死
mons[i].se=(num[i]-b*mons[i].fi+a-1)/a;//a要刀多少次
}
// int rem=1;
ll rem=1;
// sort(num+1,num+1+n);//敌方按照index序攻击!!!
// for(int i=1;i<=n;i++)cout<<num[i]<<" ";
// cout<<"_____________-"<<endl;
// sort(mons+1,mons+1+n);
int res=0;
// for(int i=1;i<=n;i++){
// cout<<mons[i].fi<<" "<<mons[i].se<<endl;
// }
for(int i=1;i<=n;i++){
// rem++;
rem+=mons[i].fi;
if(rem>=mons[i].se){
res++;
// cout<<i<<" "<<mons[i].fi<<" "<<mons[i].se<<endl;
rem-=mons[i].se;
heap.push(mons[i].se);
}
else{
rem++;//敌方会多打一次
if(heap.empty())continue;
int t=heap.top();
if(t>mons[i].se){
heap.pop();
rem=rem+t-mons[i].se;
}
}
}
cout<<res<<endl;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3532kb
input:
3 1 1 1 1 1
output:
2
result:
ok answer is '2'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3520kb
input:
3 1 1 2 2 2
output:
3
result:
ok answer is '3'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3500kb
input:
10 34 100 17 27 73 17 60 12 25 53 31 46
output:
5
result:
ok answer is '5'
Test #4:
score: 0
Accepted
time: 106ms
memory: 14384kb
input:
300000 1 1 336470888 634074578 642802746 740396295 773386884 579721198 396628655 503722503 971207868 202647942 2087506 268792718 46761498 443917727 16843338 125908043 691952768 717268783 787375312 150414369 693319712 519096230 45277106 856168102 762263554 674936674 407246545 274667941 279198849 5272...
output:
300000
result:
ok answer is '300000'
Test #5:
score: 0
Accepted
time: 114ms
memory: 14344kb
input:
300000 1 2 75475634 804928248 476927808 284875072 503158867 627937890 322595515 786026685 645468307 669240390 939887597 588586447 973764525 521365644 710156469 985188306 860350786 11308832 784695957 770562147 208427221 35937909 67590963 726478310 475357775 255361535 135993561 166967811 46718075 8515...
output:
300000
result:
ok answer is '300000'
Test #6:
score: 0
Accepted
time: 98ms
memory: 14308kb
input:
300000 1 2 374288891 535590429 751244358 124321145 232930851 266089174 543529670 773363571 319728747 580543238 582720391 468188689 490702144 598813561 138628383 284660056 733781508 155605777 931759705 245485733 723534730 257812292 794937524 596788519 188451996 981010588 14483682 59267682 959461493 3...
output:
300000
result:
ok answer is '300000'
Test #7:
score: 0
Accepted
time: 100ms
memory: 14356kb
input:
300000 1 3 673102149 561219907 730593611 814024114 812959730 314305867 469496529 350635050 699021890 342102981 815487777 787982418 857896659 526518374 421876106 438907614 902179526 449645826 783856158 865633510 238642240 774653971 962475573 467098727 196513513 561435449 333165290 951567552 726980720...
output:
300000
result:
ok answer is '300000'
Test #8:
score: 0
Accepted
time: 104ms
memory: 14344kb
input:
300000 1 4 412106895 291882089 564718673 358502890 837699009 657489855 690430685 632939232 373282330 398630021 753287868 667584659 79866982 603966291 850348020 738379364 480642952 593942770 930919906 485781288 903492853 141752547 984789430 897217447 909607734 846893014 211655411 843867422 789467242 ...
output:
300000
result:
ok answer is '300000'
Test #9:
score: 0
Accepted
time: 113ms
memory: 14400kb
input:
300000 2 5 5887448 757703054 544067926 902981667 712695184 295641139 911364840 620276118 902318577 865222469 250896470 987378388 742028793 681414208 133595743 597659626 649040970 33207011 223207847 960704874 418600362 658594226 417168695 767527655 622701955 867509363 235369723 31134588 702210660 439...
output:
300000
result:
ok answer is '300000'
Test #10:
score: 0
Accepted
time: 107ms
memory: 14344kb
input:
300000 3 4 449924898 783332532 378192988 592684636 147499872 343857831 837331700 197547597 576579017 776525316 188696560 12204822 669031820 758862125 826908873 897131377 817438988 737312468 370271596 580852652 638740575 585501313 439482552 637837864 335796176 447934224 259084035 778210267 469729886 ...
output:
300000
result:
ok answer is '300000'
Test #11:
score: 0
Accepted
time: 101ms
memory: 14416kb
input:
300000 3 3 43705451 513994713 652509537 432130709 317463343 687041819 58265855 479851779 250839457 538085060 126496650 186774359 331193631 836310042 255380788 756411639 690869710 176576709 222368048 906033133 8623893 807375696 461796409 362923880 194114590 733391789 137574156 670510137 237249112 673...
output:
300000
result:
ok answer is '300000'
Test #12:
score: 0
Accepted
time: 101ms
memory: 14384kb
input:
300000 3 9 782710197 539624191 631858791 976609486 752268030 30225807 279200011 467188665 630132600 594612100 769329445 916633496 258196658 913757959 538628510 55883389 859267729 615840950 514655989 526180911 523731402 324217375 189142970 643299496 907208811 754008138 161288468 562810007 149992530 9...
output:
300000
result:
ok answer is '300000'
Test #13:
score: 0
Accepted
time: 86ms
memory: 14408kb
input:
300000 8 8 640274071 983359971 71550121 96204862 799843967 446173607 796619138 402690754 223219513 668171337 312183499 905549873 673542337 566661387 879397647 434495917 631413076 150918417 579868000 224422012 126195703 525305826 535526356 404334728 653535984 998133227 879226371 59632864 356493387 62...
output:
300000
result:
ok answer is '300000'
Test #14:
score: 0
Accepted
time: 114ms
memory: 14412kb
input:
300000 4 20 509061481 552472140 16115810 148658854 66743034 628305150 677780684 519361360 208050516 401554301 954478790 346543678 387546138 832279893 641889899 80960260 717802881 588066499 661699500 83254572 759454419 427833657 255743179 199661234 694729965 875591136 862937826 103626886 473906880 20...
output:
300000
result:
ok answer is '300000'
Test #15:
score: 0
Accepted
time: 97ms
memory: 14340kb
input:
300000 15 31 235040736 845224325 405102476 306020832 567954026 319923972 351391400 839247099 872095141 746927386 116079799 814749285 935104039 39200818 779623552 24872203 857355273 463838168 642352783 774850365 394389351 835930945 10847154 880608047 403727586 922549184 104520573 235608953 266338849 ...
output:
300000
result:
ok answer is '300000'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
1 1 1 1
output:
1
result:
ok answer is '1'
Test #17:
score: 0
Accepted
time: 2ms
memory: 3504kb
input:
1 1 1 5
output:
1
result:
ok answer is '1'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
1 1 2 2
output:
0
result:
ok answer is '0'
Test #19:
score: 0
Accepted
time: 2ms
memory: 3504kb
input:
1 2 1 2
output:
1
result:
ok answer is '1'
Test #20:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
1 7 9 3
output:
1
result:
ok answer is '1'
Test #21:
score: 0
Accepted
time: 2ms
memory: 3508kb
input:
1 7 3 9
output:
1
result:
ok answer is '1'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
1 7 51 50
output:
0
result:
ok answer is '0'
Test #23:
score: 0
Accepted
time: 3ms
memory: 3504kb
input:
1 79 51 96
output:
1
result:
ok answer is '1'
Test #24:
score: 0
Accepted
time: 3ms
memory: 3500kb
input:
1 60 820 533
output:
0
result:
ok answer is '0'
Test #25:
score: 0
Accepted
time: 3ms
memory: 3564kb
input:
1 664 188 495
output:
1
result:
ok answer is '1'
Test #26:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
1 297208 929600 614363
output:
0
result:
ok answer is '0'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
1 589156 45728 619108
output:
1
result:
ok answer is '1'
Test #28:
score: 0
Accepted
time: 3ms
memory: 3652kb
input:
1 505899152 526332989 621636272
output:
1
result:
ok answer is '1'
Test #29:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
1 409449117 374415292 920449529
output:
1
result:
ok answer is '1'
Test #30:
score: 0
Accepted
time: 2ms
memory: 3568kb
input:
2 1 1 1 1
output:
1
result:
ok answer is '1'
Test #31:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
2 1 1 3 1
output:
2
result:
ok answer is '2'
Test #32:
score: 0
Accepted
time: 2ms
memory: 3524kb
input:
2 1 1 2 1
output:
2
result:
ok answer is '2'
Test #33:
score: 0
Accepted
time: 2ms
memory: 3560kb
input:
2 2 1 2 1
output:
2
result:
ok answer is '2'
Test #34:
score: 0
Accepted
time: 2ms
memory: 3472kb
input:
2 5 6 9 9
output:
2
result:
ok answer is '2'
Test #35:
score: 0
Accepted
time: 2ms
memory: 3576kb
input:
2 10 9 1 7
output:
1
result:
ok answer is '1'
Test #36:
score: 0
Accepted
time: 2ms
memory: 3580kb
input:
2 4 77 3 29
output:
1
result:
ok answer is '1'
Test #37:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
2 33 29 49 7
output:
2
result:
ok answer is '2'
Test #38:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
2 982 988 630 233
output:
1
result:
ok answer is '1'
Test #39:
score: 0
Accepted
time: 2ms
memory: 3568kb
input:
2 833 406 183 414
output:
2
result:
ok answer is '2'
Test #40:
score: 0
Accepted
time: 2ms
memory: 3524kb
input:
2 311557 743280 610538 535909
output:
1
result:
ok answer is '1'
Test #41:
score: 0
Accepted
time: 2ms
memory: 3552kb
input:
2 394981 292125 391092 198091
output:
2
result:
ok answer is '2'
Test #42:
score: 0
Accepted
time: 3ms
memory: 3500kb
input:
2 578786981 772798219 803767815 685001280
output:
1
result:
ok answer is '1'
Test #43:
score: 0
Accepted
time: 2ms
memory: 5612kb
input:
2 756870405 346347063 247805265 415663462
output:
2
result:
ok answer is '2'
Test #44:
score: 0
Accepted
time: 3ms
memory: 5568kb
input:
10 1 1 1 1 1 1 1 1 1 1 1 1
output:
5
result:
ok answer is '5'
Test #45:
score: 0
Accepted
time: 2ms
memory: 5576kb
input:
10 1 1 4 5 2 5 3 5 3 2 1 2
output:
10
result:
ok answer is '10'
Test #46:
score: 0
Accepted
time: 2ms
memory: 5456kb
input:
10 1 2 2 2 2 1 1 2 1 1 1 2
output:
5
result:
ok answer is '5'
Test #47:
score: 0
Accepted
time: 3ms
memory: 5460kb
input:
10 1 1 1 2 1 2 2 2 1 2 1 1
output:
8
result:
ok answer is '8'
Test #48:
score: 0
Accepted
time: 0ms
memory: 5544kb
input:
10 8 10 9 5 4 8 8 10 8 1 6 2
output:
5
result:
ok answer is '5'
Test #49:
score: 0
Accepted
time: 2ms
memory: 5568kb
input:
10 10 10 7 9 8 3 3 10 7 3 3 10
output:
5
result:
ok answer is '5'
Test #50:
score: 0
Accepted
time: 2ms
memory: 5512kb
input:
10 34 100 17 27 73 17 60 12 25 53 31 46
output:
5
result:
ok answer is '5'
Test #51:
score: 0
Accepted
time: 3ms
memory: 5548kb
input:
10 58 41 74 4 27 85 39 100 85 36 71 85
output:
9
result:
ok answer is '9'
Test #52:
score: 0
Accepted
time: 0ms
memory: 5660kb
input:
10 433 514 452 478 193 55 745 40 365 655 96 617
output:
7
result:
ok answer is '7'
Test #53:
score: 0
Accepted
time: 0ms
memory: 5596kb
input:
10 857 358 197 660 447 320 433 28 520 133 240 465
output:
8
result:
ok answer is '8'
Test #54:
score: 0
Accepted
time: 0ms
memory: 5572kb
input:
10 709678 848878 71446 771626 318378 706628 211084 370645 452763 725527 561797 990677
output:
6
result:
ok answer is '6'
Test #55:
score: 0
Accepted
time: 2ms
memory: 5564kb
input:
10 825806 397723 76191 433807 410736 152700 207259 554633 386918 29709 854941 517716
output:
8
result:
ok answer is '8'
Test #56:
score: 0
Accepted
time: 2ms
memory: 5616kb
input:
10 322022227 751269818 629795150 369443545 344607287 250044294 476897672 184054549 986884572 917181121 650451600 554222064
output:
5
result:
ok answer is '5'
Test #57:
score: 0
Accepted
time: 2ms
memory: 5576kb
input:
10 324818663 205138355 223575704 395073023 323956540 794523071 206669655 527238537 207818728 199485303 884520552 315781807
output:
10
result:
ok answer is '10'
Test #58:
score: 0
Accepted
time: 2ms
memory: 5572kb
input:
100 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:
50
result:
ok answer is '50'
Test #59:
score: 0
Accepted
time: 2ms
memory: 5656kb
input:
100 1 1 3 3 5 3 2 1 1 4 1 3 4 2 2 4 1 1 4 3 4 5 3 4 1 3 5 2 5 4 4 1 5 4 2 4 4 3 1 2 3 4 2 5 3 4 5 4 3 5 4 4 3 2 4 5 3 4 3 3 5 2 5 3 4 2 1 1 3 1 2 2 3 4 4 3 4 4 5 5 1 5 1 3 4 4 4 4 4 5 1 1 3 2 5 3 1 3 4 3 5 3
output:
100
result:
ok answer is '100'
Test #60:
score: 0
Accepted
time: 2ms
memory: 5616kb
input:
100 1 1 2 1 2 1 1 2 2 1 2 1 1 1 1 1 1 1 1 1 1 1 2 2 1 1 1 1 1 2 1 2 2 2 1 2 2 1 2 2 2 1 2 2 2 2 2 1 2 2 2 2 1 1 1 1 1 1 1 2 2 2 2 1 2 2 1 1 1 2 1 2 1 1 2 2 2 2 1 1 2 1 2 1 2 1 1 1 2 1 1 1 1 2 1 1 2 1 2 2 1 2
output:
73
result:
ok answer is '73'
Test #61:
score: 0
Accepted
time: 0ms
memory: 5596kb
input:
100 2 1 1 1 1 2 1 2 1 2 1 2 1 2 2 2 1 1 1 2 2 1 1 1 2 1 2 2 2 2 1 2 1 2 1 2 2 1 1 1 2 2 1 2 1 2 1 1 2 1 1 2 2 2 2 1 2 2 1 1 1 1 2 1 1 1 2 1 2 2 2 2 2 2 2 2 2 1 2 1 2 1 2 2 1 1 2 1 1 2 1 2 1 1 1 1 2 2 2 1 1 2
output:
76
result:
ok answer is '76'
Test #62:
score: 0
Accepted
time: 3ms
memory: 5552kb
input:
100 9 9 8 8 8 6 5 7 10 1 4 5 9 10 5 2 1 1 4 3 10 6 5 10 5 7 6 2 5 5 10 1 1 8 2 5 7 6 7 6 4 3 3 6 10 7 7 9 2 4 1 10 9 8 7 10 4 2 6 7 7 10 5 2 1 4 5 8 3 3 3 7 2 4 4 7 9 7 5 3 4 10 3 9 8 7 2 3 7 7 1 4 2 5 9 6 10 4 10 5 8 1
output:
56
result:
ok answer is '56'
Test #63:
score: 0
Accepted
time: 2ms
memory: 5576kb
input:
100 9 3 3 9 1 9 9 9 7 8 3 8 9 3 10 9 6 9 2 7 2 2 9 3 10 9 3 9 8 5 6 4 9 10 1 2 4 1 2 9 7 4 8 5 9 1 9 9 8 2 7 2 5 8 7 5 3 3 5 9 1 9 4 4 2 9 10 6 2 1 6 7 7 6 9 2 5 10 10 1 5 2 3 7 9 5 4 5 6 6 9 6 2 10 8 10 8 5 2 9 9 7
output:
100
result:
ok answer is '100'
Test #64:
score: 0
Accepted
time: 3ms
memory: 5596kb
input:
100 94 95 31 65 35 95 70 78 81 36 69 97 39 28 89 62 36 23 35 21 36 11 65 39 13 34 79 87 91 70 43 82 24 97 6 87 49 81 60 92 63 9 16 6 31 90 6 5 70 48 27 86 65 66 45 8 67 17 24 44 34 93 26 32 82 54 72 83 94 81 79 79 9 9 4 59 42 83 80 67 28 62 56 58 87 67 34 3 61 14 62 19 94 31 74 97 20 70 7 98 64 67
output:
52
result:
ok answer is '52'
Test #65:
score: 0
Accepted
time: 1ms
memory: 5520kb
input:
100 39 23 85 46 97 72 41 70 37 18 8 40 33 61 12 79 51 78 61 66 85 97 78 14 70 47 100 40 15 40 61 52 19 30 14 91 82 56 10 6 68 24 97 61 31 78 18 45 88 6 37 38 51 86 37 42 58 30 79 56 50 14 61 18 13 20 57 3 93 15 24 74 32 21 71 93 2 66 25 75 75 10 86 82 30 31 6 49 15 33 100 35 1 96 87 83 29 21 41 22 4...
output:
100
result:
ok answer is '100'
Test #66:
score: 0
Accepted
time: 3ms
memory: 5600kb
input:
100 81 122 18 561 601 538 804 877 55 943 955 751 206 881 249 227 640 846 6 935 544 383 628 688 609 898 25 669 837 272 848 595 599 376 280 855 953 122 779 687 751 29 97 18 666 571 123 11 223 527 88 26 901 493 923 371 947 411 378 228 423 816 497 219 439 228 573 183 156 144 426 610 11 849 310 893 682 1...
output:
100
result:
ok answer is '100'
Test #67:
score: 0
Accepted
time: 0ms
memory: 5616kb
input:
100 925 250 572 743 855 507 979 865 211 125 395 495 808 314 572 848 259 596 24 984 996 968 433 559 466 810 950 530 957 142 778 673 890 808 581 751 387 901 17 606 148 144 582 472 855 358 446 847 841 186 906 270 187 610 627 605 537 32 425 841 934 433 832 497 175 889 62 818 755 278 271 693 26 361 889 3...
output:
100
result:
ok answer is '100'
Test #68:
score: 0
Accepted
time: 3ms
memory: 5624kb
input:
100 312789 538116 666304 930504 856780 954598 358328 222020 393708 667786 445050 120840 580902 173462 493608 35452 521199 48788 969577 965294 392513 838387 137129 646732 85145 370116 693590 396843 843383 785981 973988 119108 949857 895866 425226 207409 650272 118647 147651 828852 848256 616535 12583...
output:
67
result:
ok answer is '67'
Test #69:
score: 0
Accepted
time: 3ms
memory: 5576kb
input:
100 363509 86961 479561 592686 981841 657567 130312 373304 327863 939264 738193 647879 348288 742999 655419 707561 993114 296346 400299 5342 456262 761972 244638 521115 399002 680324 787811 789000 590399 53148 717406 372482 35252 839298 227335 610521 452297 348722 767593 394771 321253 234649 291619 ...
output:
100
result:
ok answer is '100'
Test #70:
score: 0
Accepted
time: 3ms
memory: 5700kb
input:
100 348479310 617722226 734818338 418154900 301651637 10534985 81960960 525844408 908632707 334892077 367781717 862809937 829172860 579141787 414535294 293924102 726156087 237984260 314162669 471274418 416657569 523876428 28589735 284844258 431932024 182350667 125220039 228439898 711430865 202509136...
output:
62
result:
ok answer is '62'
Test #71:
score: 0
Accepted
time: 3ms
memory: 5568kb
input:
100 231595438 191271071 328598891 148817081 281000890 555013762 811732943 163995692 539632270 617196260 42042156 624369681 472005654 898935517 931472913 516596211 714436514 537456010 482560687 910538658 563721318 703832718 543697245 946910129 159278585 52660876 133281556 249056247 884888282 38977630...
output:
100
result:
ok answer is '100'
Test #72:
score: 0
Accepted
time: 3ms
memory: 5636kb
input:
1000 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 1 1 1 1 1 1 1 1 1 1...
output:
500
result:
ok answer is '500'
Test #73:
score: 0
Accepted
time: 3ms
memory: 5640kb
input:
1000 1 1 5 5 3 1 4 3 1 4 3 1 3 3 5 2 4 5 3 2 2 1 2 3 3 1 4 5 5 3 1 1 5 1 1 3 5 2 1 3 2 4 3 5 3 3 3 2 2 3 1 5 2 1 2 1 1 2 1 5 2 2 4 5 5 4 5 4 1 3 2 2 3 1 3 3 2 5 3 5 1 2 2 5 4 3 2 5 5 4 2 4 3 2 5 5 3 5 3 4 1 4 3 5 5 2 5 1 5 4 2 3 1 4 5 3 2 4 2 3 1 1 2 4 5 1 5 3 4 1 3 4 2 1 1 5 5 4 4 2 3 5 5 2 1 1 5 4...
output:
1000
result:
ok answer is '1000'
Test #74:
score: 0
Accepted
time: 3ms
memory: 5636kb
input:
1000 1 1 2 1 1 1 1 1 2 2 2 1 2 2 2 2 1 2 1 2 1 1 1 2 2 1 1 2 1 2 1 2 2 1 1 2 1 2 2 1 2 2 2 2 2 2 1 2 1 1 1 1 2 2 2 2 2 1 1 1 2 1 2 2 2 1 1 1 1 2 1 2 1 1 1 1 1 1 2 1 2 1 1 2 1 2 2 1 2 1 1 2 2 1 1 1 1 2 2 2 2 2 1 2 1 1 2 2 2 1 1 2 2 2 2 1 1 2 1 2 2 1 1 1 2 1 1 2 2 1 2 2 2 2 1 1 2 1 1 2 1 1 1 1 2 1 1 1...
output:
747
result:
ok answer is '747'
Test #75:
score: 0
Accepted
time: 2ms
memory: 5720kb
input:
1000 2 1 2 1 2 2 2 1 1 2 1 1 2 1 1 1 2 2 1 1 1 1 1 1 1 2 2 1 1 1 1 2 1 1 2 2 1 1 1 2 1 2 1 1 1 2 2 2 1 1 1 2 1 1 2 1 2 2 2 1 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 1 1 2 1 1 1 1 2 2 2 2 2 1 1 1 1 2 1 2 2 1 1 1 2 1 1 2 2 1 1 1 1 1 1 1 1 2 2 1 2 2 2 1 2 1 1 2 1 1 1 2 1 2 2 1 2 1 1 1 1 2 1 2 2 1 1 1 2 1 1 1 2 1...
output:
746
result:
ok answer is '746'
Test #76:
score: 0
Accepted
time: 0ms
memory: 5592kb
input:
1000 5 10 4 10 10 5 7 7 2 4 5 6 8 3 1 8 9 2 8 9 4 9 1 3 9 5 9 8 2 3 6 3 9 7 5 8 4 2 8 10 3 7 6 3 7 6 2 3 10 9 2 3 5 6 10 7 7 5 2 4 2 3 3 5 10 7 6 3 9 5 7 8 5 3 2 4 1 3 9 4 6 4 3 1 2 10 5 10 5 8 5 2 8 3 9 1 3 7 8 10 6 1 5 7 3 7 9 5 9 8 7 7 8 10 8 9 7 7 3 8 7 3 4 3 8 1 10 8 2 4 10 5 9 9 3 6 2 3 8 7 2 ...
output:
498
result:
ok answer is '498'
Test #77:
score: 0
Accepted
time: 2ms
memory: 5484kb
input:
1000 8 7 8 7 7 7 5 1 1 6 9 9 8 6 10 9 1 10 6 2 7 5 10 6 8 3 10 9 8 3 6 2 8 9 10 8 10 7 2 4 6 10 2 9 4 9 3 3 4 6 6 7 8 10 10 5 9 6 3 6 9 6 3 7 1 8 10 6 8 9 2 10 4 1 2 10 7 8 2 10 9 1 1 7 5 6 7 3 4 1 3 7 9 4 8 6 1 5 10 4 7 7 6 4 8 3 8 8 4 3 10 2 10 9 6 2 3 8 1 6 2 9 8 7 4 5 5 10 6 2 2 1 8 6 9 2 2 10 8...
output:
673
result:
ok answer is '673'
Test #78:
score: 0
Accepted
time: 0ms
memory: 5576kb
input:
1000 61 100 98 48 52 83 17 28 76 16 23 27 8 36 62 67 62 11 78 12 28 65 6 74 66 60 6 16 69 62 83 26 61 32 80 24 36 3 25 12 61 19 7 17 18 15 1 22 23 95 6 3 60 38 73 41 71 20 58 60 35 41 28 28 74 64 26 50 56 85 77 34 46 56 61 27 44 15 80 91 15 84 17 47 68 97 54 65 47 98 75 70 25 46 68 56 78 94 95 32 10...
output:
500
result:
ok answer is '500'
Test #79:
score: 0
Accepted
time: 0ms
memory: 5632kb
input:
1000 20 5 47 29 5 55 100 12 31 98 75 75 98 65 81 88 76 70 100 57 81 51 12 53 23 81 23 81 82 36 1 100 48 68 93 32 66 74 63 31 54 34 88 71 7 91 17 62 37 54 27 51 54 66 73 71 61 37 5 77 39 54 67 6 5 30 15 73 55 19 34 20 57 68 36 58 100 98 25 99 69 36 43 71 3 69 14 15 96 20 8 86 36 15 89 46 94 53 37 44 ...
output:
1000
result:
ok answer is '1000'
Test #80:
score: 0
Accepted
time: 3ms
memory: 5484kb
input:
1000 520 999 552 931 480 348 671 930 534 80 510 4 176 583 686 73 81 239 523 968 447 468 517 286 523 285 929 366 764 533 310 580 524 635 33 153 49 146 57 58 54 250 115 705 207 229 111 266 776 787 273 191 143 342 257 157 38 663 995 53 586 135 360 540 78 479 884 435 825 808 438 295 523 380 810 658 700 ...
output:
497
result:
ok answer is '497'
Test #81:
score: 0
Accepted
time: 2ms
memory: 5592kb
input:
1000 944 844 514 113 733 613 358 918 393 558 949 748 971 16 9 990 996 989 541 208 899 350 323 670 84 493 446 227 180 403 536 554 919 67 333 457 483 925 590 465 346 172 896 159 204 312 922 510 394 957 91 139 236 163 153 688 821 284 850 369 993 752 695 626 110 844 372 263 424 134 282 378 539 83 686 88...
output:
573
result:
ok answer is '573'
Test #82:
score: 0
Accepted
time: 3ms
memory: 5540kb
input:
1000 88652 219391 118712 729500 600839 223140 849019 285308 150862 415920 156006 609740 168775 601066 367433 495436 753034 924779 179173 247247 334947 886625 333681 402366 984659 888845 35864 430931 950927 152325 108921 870750 759231 97203 97510 703428 811136 166676 565541 377658 66851 103545 22322 ...
output:
996
result:
ok answer is '996'
Test #83:
score: 0
Accepted
time: 0ms
memory: 5572kb
input:
1000 544044 172076 931969 615873 950092 701917 653706 469296 117722 976999 416446 202188 936162 203308 529244 943353 756 172338 609895 287296 622888 34403 408487 468237 298516 7565 130086 855792 665240 419491 628147 381021 877330 73339 932323 330732 613162 364046 152779 943577 315656 497468 188103 7...
output:
1000
result:
ok answer is '1000'
Test #84:
score: 0
Accepted
time: 2ms
memory: 5596kb
input:
1000 298882680 625881105 595389444 692470 424798881 288162168 461901905 63721259 180515960 847022240 526763419 325243078 960313706 835408525 476178687 151932619 610934120 208024163 364414050 779453603 355704679 368216046 498269419 430890650 590794721 171428891 604775299 246009952 95168851 377023357 ...
output:
647
result:
ok answer is '647'
Test #85:
score: 0
Accepted
time: 2ms
memory: 5572kb
input:
1000 476966104 199429949 189169997 321289244 404148134 832640944 336898080 111937951 401450115 424293718 201023858 381770117 603146500 155202254 698149010 374604728 744438738 507495913 532812068 73493652 353025324 843139632 868152736 652765034 613108578 746771803 612836817 971659005 118883163 269323...
output:
1000
result:
ok answer is '1000'
Test #86:
score: 0
Accepted
time: 38ms
memory: 12328kb
input:
300000 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 1 1 1 1 1 1 1 1 1...
output:
150000
result:
ok answer is '150000'
Test #87:
score: 0
Accepted
time: 42ms
memory: 14424kb
input:
300000 1 1 5 5 5 3 1 1 4 5 5 5 3 5 2 5 5 5 4 3 1 4 3 5 1 2 4 3 4 2 2 2 2 1 2 3 1 3 2 3 3 5 1 1 4 3 5 2 5 4 4 3 2 5 2 5 1 3 4 3 2 2 5 1 3 2 3 5 1 5 5 5 1 1 2 3 3 3 4 2 4 1 1 3 2 1 2 1 5 2 5 2 3 2 5 3 2 2 5 5 4 4 3 1 2 1 2 4 5 5 4 2 5 5 2 2 4 3 3 1 1 1 1 1 2 5 2 4 1 3 3 4 1 1 1 5 1 2 4 3 4 3 1 5 4 3 5...
output:
300000
result:
ok answer is '300000'
Test #88:
score: 0
Accepted
time: 46ms
memory: 12264kb
input:
300000 1 1 1 2 2 2 2 1 1 1 2 2 2 1 2 1 2 2 2 2 2 1 1 1 1 2 2 2 1 2 1 2 1 2 2 1 1 2 2 2 1 2 1 2 1 2 1 1 2 1 2 1 1 2 1 2 1 2 1 2 1 2 2 2 2 1 1 2 2 1 1 1 2 1 1 2 2 1 1 1 2 1 2 2 1 2 2 1 2 1 1 2 1 1 2 2 2 1 2 1 2 2 1 2 1 1 1 2 1 2 2 1 1 2 2 1 2 2 1 2 2 1 2 1 1 2 2 1 1 2 1 2 1 1 2 2 2 1 1 2 2 1 2 2 1 2 1...
output:
224941
result:
ok answer is '224941'
Test #89:
score: 0
Accepted
time: 45ms
memory: 12260kb
input:
300000 1 1 1 2 1 1 1 1 2 1 1 2 1 1 1 2 1 1 2 1 1 1 2 2 2 1 1 1 1 2 1 1 2 2 2 1 1 1 1 1 2 2 2 2 2 1 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 1 1 1 2 1 1 1 2 2 2 2 2 1 1 1 2 1 2 2 2 2 2 2 1 1 2 2 1 1 2 2 2 1 1 2 1 1 1 1 1 1 2 1 1 2 1 1 2 2 1 2 2 2 2 2 2 2 1 2 2 2 1 1 2 2 2 1 2 2 2 2 2 1 2 2 1 2 2 2 2...
output:
224992
result:
ok answer is '224992'
Test #90:
score: -100
Wrong Answer
time: 47ms
memory: 11148kb
input:
300000 3 10 6 1 5 8 6 9 9 4 7 9 6 2 1 2 6 7 8 8 1 3 7 8 10 3 6 7 2 8 4 1 10 1 1 2 1 7 3 6 5 7 1 4 8 9 3 7 4 3 6 2 8 7 4 3 2 7 3 9 10 8 8 1 4 9 5 10 6 9 6 6 7 4 2 1 7 10 5 9 8 9 2 9 10 8 1 9 10 2 10 3 1 2 2 4 10 8 7 9 2 4 5 6 3 10 2 1 7 5 7 4 4 3 8 6 5 4 2 7 10 8 8 4 8 5 7 1 4 2 10 5 5 9 8 5 7 8 3 4 ...
output:
129853
result:
wrong answer expected '129911', found '129853'