We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- All Contests
- HourRank 22
- Candy Collection
- Discussions
Candy Collection
Candy Collection
Sort by
recency
|
13 Discussions
|
Please Login in order to post a comment
What is wrong in the following output (Do not consider extra informations printed)
MIN COST = 1062
Crate 0 --------- num.candy color
Crate 1 --------- num.candy color
The output for the accepted code is 1918.
Input
50
528 660 755 585 247 202 134 146 395 555 893 813 227 194 261 847 639 575 704 619 36 777 432 756 181 862 971 686 442 457 499 330 757 657 580 678 612 203 752 238 642 348 839 570 755 800 221 160 454 952
811 311 95 342 994 776 576 687 843 265 430 342 505 119 753 493 234 179 370 343 196 802 753 537 777 705 621 422 353 804 721 65 746 979 91 886 535 346 306 181 684 89 186 490 39 592 838 651 466 136
i didnt get the editorial , would anybody care to elaborate it ? :'(
int main() { int n,i,j,l=0,p=0,s=1,k=0; scanf("%d",&n); int a[n],b[n]; for(i=0;i
} whats wrong
Can someone tell why are the example inputs separated as they are? Take the second one as example, why crate one has 3 elements (9 9 9) while crate two has 2 elements (2 2)? Take a similar example, but with candies = (9 9 9 10 2). Using the same separation of boxes like the example (which is what I dont understand), the result would be = (9 9 9) (10 2) = 9 + 10 = 19. However, since only the last color repeats, the logical separation of boxes for me would be (9 9 9 10) and (2), which is = 10 + 2 = 12.
Am I missing something?
Shouldn't a crate have all unique Ti's? Why didn't this work? The question seemed simple at the first glance