FPEvalDataset/LeetCodeProblem
0302
1{2 "id": 2808,3 "name": "painting_the_walls",4 "difficulty": "Hard",5 "link": "https://leetcode.com/problems/painting-the-walls/",6 "date": "2023-06-11 00:00:00",7 "task_description": "You are given two **0-indexed** integer arrays, `cost` and `time`, of size `n` representing the costs and the time taken to paint `n` different walls respectively. There are two painters available: A** paid painter** that paints the `ith` wall in `time[i]` units of time and takes `cost[i]` units of money. A** free painter** that paints **any** wall in `1` unit of time at a cost of `0`. But the free painter can only be used if the paid painter is already **occupied**. Return _the minimum amount of money required to paint the _`n`_ walls._ **Example 1:** ``` **Input:** cost = [1,2,3,2], time = [1,2,3,2] **Output:** 3 **Explanation:** The walls at index 0 and 1 will be painted by the paid painter, and it will take 3 units of time; meanwhile, the free painter will paint the walls at index 2 and 3, free of cost in 2 units of time. Thus, the total cost is 1 + 2 = 3. ``` **Example 2:** ``` **Input:** cost = [2,3,4,2], time = [1,1,1,1] **Output:** 4 **Explanation:** The walls at index 0 and 3 will be painted by the paid painter, and it will take 2 units of time; meanwhile, the free painter will paint the walls at index 1 and 2, free of cost in 2 units of time. Thus, the total cost is 2 + 2 = 4. ``` **Constraints:** `1 <= cost.length <= 500` `cost.length == time.length` `1 <= cost[i] <= 106` `1 <= time[i] <= 500`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "cost = [1,2,3,2], time = [1,2,3,2]",12 "output": "3 "13 },14 {15 "label": "Example 2",16 "input": "cost = [2,3,4,2], time = [1,1,1,1]",17 "output": "4 "18 }19 ],20 "private_test_cases": [21 {22 "input": [23 [24 268643,25 752013,26 318161,27 524677,28 374576,29 71970,30 869505,31 753435,32 713518,33 555757,34 432948,35 39983,36 919949,37 998079,38 743129,39 632026,40 954321,41 86066,42 487112,43 219176,44 526603,45 707334,46 847105,47 844438,48 662067,49 134805,50 97818,51 579412,52 839247,53 646698,54 219873,55 591959,56 963949,57 368585,58 860097,59 995546,60 607846,61 794911,62 341445,63 566022,64 226895,65 724644,66 214879,67 1224,68 125133,69 631015,70 349852,71 947247,72 165023,73 580195,74 7821,75 731000,76 524780,77 71120,78 233463,79 840417,80 756273,81 504263,82 376014,83 536514,84 257219,85 590802,86 615186,87 318017,88 721816,89 75727,90 259781,91 834518,92 446513,93 650293,94 51585,95 287106,96 148135,97 643831,98 336710,99 472402,100 525148,101 736766,102 654887,103 702024,104 977224,105 534789,106 524642,107 387706,108 692517,109 571525,110 939096,111 164256,112 63828,113 703658,114 806005,115 452115,116 10093,117 161712,118 269827,119 395792,120 6388,121 340843,122 903234,123 21804,124 655074,125 968151,126 713861,127 764184,128 753589,129 131157,130 706735,131 186618,132 253999,133 375799,134 274504,135 58355,136 853990,137 788371,138 87125,139 37646,140 535702,141 399072,142 954288,143 571946,144 908174,145 47192,146 167639,147 930987,148 567730,149 769180,150 952783,151 5104,152 37700,153 749527,154 329309,155 636215,156 645541,157 868987,158 214681,159 69876,160 153598,161 546001,162 910316,163 232998,164 429262,165 833199,166 215902,167 692400,168 37338,169 210426,170 429757,171 188895,172 71745,173 491429,174 985882,175 407873,176 705374,177 696411,178 94483,179 983842,180 299451,181 114047,182 957948,183 220421,184 536487,185 657446,186 299160,187 237534,188 413175,189 831359,190 534403,191 503757,192 428862,193 491142,194 933802,195 45408,196 495984,197 216287,198 22281,199 312069,200 297321,201 998372,202 801067,203 453947,204 254632,205 227422,206 78780,207 217526,208 599246,209 116704,210 748265,211 922753,212 978512,213 474290,214 384912,215 841481,216 780530,217 840285,218 549211,219 226337,220 489835,221 803716,222 498851,223 991346,224 268561,225 797339,226 110448,227 929171,228 865408,229 225606,230 972804,231 430652,232 436186,233 862140,234 372258,235 933431,236 720598,237 901910,238 674953,239 249997,240 271784,241 733756,242 211323,243 274067,244 705862,245 676353,246 686812,247 709634,248 55379,249 517632,250 328622,251 679798,252 826822,253 596440,254 188536,255 997377,256 598642,257 652474,258 682295,259 7392,260 456962,261 27696,262 969305,263 724757,264 288412,265 348399,266 670232,267 121396,268 675422,269 664409,270 469005,271 206405,272 945464,273 66504,274 643527,275 745406,276 790754,277 811590,278 511994,279 487778,280 359376,281 944804,282 709979,283 93876,284 784462,285 54152,286 968032,287 278407,288 293901,289 373199,290 833798,291 59173,292 15748,293 731829,294 559825,295 985302,296 639013,297 106196,298 730480,299 584668,300 135533,301 80031,302 551554,303 637390,304 995410,305 261960,306 496932,307 410176,308 361604,309 963798,310 806467,311 543085,312 229218,313 547445,314 252242,315 619774,316 749657,317 63719,318 891703,319 485297,320 832433,321 132769,322 627085,323 938083,324 453512,325 570305,326 341200,327 575882,328 154468,329 190979,330 350680,331 284335,332 177392,333 901085334 ],335 [336 131,337 44,338 371,339 455,340 257,341 472,342 218,343 173,344 191,345 229,346 58,347 370,348 404,349 258,350 99,351 4,352 342,353 25,354 239,355 284,356 93,357 446,358 299,359 109,360 286,361 434,362 472,363 55,364 99,365 346,366 356,367 279,368 240,369 352,370 284,371 49,372 427,373 120,374 484,375 319,376 20,377 182,378 25,379 49,380 227,381 439,382 451,383 187,384 228,385 499,386 470,387 240,388 87,389 116,390 155,391 462,392 407,393 354,394 106,395 219,396 386,397 421,398 14,399 109,400 315,401 17,402 335,403 499,404 318,405 178,406 500,407 78,408 309,409 25,410 403,411 104,412 84,413 328,414 244,415 368,416 410,417 28,418 204,419 15,420 497,421 238,422 82,423 166,424 114,425 323,426 55,427 419,428 40,429 14,430 160,431 162,432 48,433 374,434 79,435 479,436 125,437 277,438 139,439 190,440 362,441 365,442 5,443 319,444 17,445 101,446 49,447 374,448 426,449 267,450 303,451 25,452 257,453 139,454 48,455 17,456 351,457 150,458 314,459 224,460 439,461 278,462 140,463 350,464 295,465 460,466 133,467 329,468 56,469 21,470 13,471 258,472 395,473 234,474 65,475 234,476 258,477 219,478 500,479 310,480 51,481 332,482 13,483 400,484 263,485 129,486 375,487 168,488 88,489 450,490 376,491 95,492 394,493 209,494 120,495 214,496 404,497 437,498 395,499 19,500 301,501 476,502 500,503 422,504 234,505 454,506 235,507 156,508 376,509 93,510 39,511 323,512 126,513 495,514 214,515 477,516 498,517 184,518 265,519 69,520 302,521 10,522 279,523 121,524 400,525 387,526 212,527 475,528 143,529 367,530 215,531 341,532 155,533 270,534 177,535 244,536 43,537 129,538 405,539 339,540 464,541 253,542 66,543 392,544 139,545 130,546 492,547 465,548 110,549 313,550 90,551 480,552 141,553 453,554 295,555 83,556 218,557 261,558 372,559 203,560 211,561 497,562 68,563 309,564 407,565 292,566 76,567 280,568 432,569 53,570 448,571 380,572 26,573 183,574 88,575 298,576 15,577 296,578 119,579 193,580 324,581 241,582 102,583 72,584 16,585 149,586 251,587 140,588 45,589 233,590 430,591 459,592 77,593 69,594 101,595 135,596 234,597 495,598 342,599 267,600 158,601 167,602 312,603 29,604 124,605 421,606 483,607 81,608 487,609 99,610 349,611 141,612 298,613 309,614 252,615 274,616 5,617 40,618 41,619 404,620 458,621 221,622 249,623 204,624 413,625 131,626 328,627 114,628 127,629 414,630 487,631 381,632 49,633 258,634 166,635 383,636 330,637 224,638 147,639 80,640 480,641 300,642 199,643 436,644 69,645 349646 ]647 ],648 "output": 5104649 },650 {651 "input": [652 [653 631329,654 506660,655 874006,656 401735,657 430561,658 164160,659 733867,660 138222,661 156550,662 808780,663 985691,664 657587,665 454859,666 26589,667 286211,668 316886,669 690358,670 852726,671 534985,672 74133,673 739358,674 244539,675 482883,676 933540,677 548468,678 762765,679 649239,680 322588,681 941345,682 333442,683 827161,684 902433,685 361815,686 664147,687 464517,688 684981,689 793801,690 451318,691 649211,692 86156,693 662848,694 862040,695 960861,696 59335,697 893175,698 317614,699 536319,700 377137,701 16431,702 124016,703 11964,704 303335,705 940093,706 515074,707 403052,708 32856,709 14421,710 681882,711 637736,712 42382,713 857659,714 829788,715 207282,716 512718,717 153297,718 899340,719 657254,720 379387,721 581472,722 825855,723 945933,724 977553,725 86675726 ],727 [728 335,729 9,730 355,731 469,732 231,733 55,734 197,735 474,736 369,737 174,738 46,739 420,740 228,741 432,742 301,743 311,744 410,745 346,746 420,747 70,748 485,749 436,750 66,751 424,752 300,753 12,754 350,755 294,756 484,757 191,758 334,759 137,760 179,761 343,762 192,763 471,764 366,765 389,766 466,767 80,768 280,769 8,770 380,771 387,772 477,773 290,774 235,775 215,776 458,777 206,778 167,779 202,780 353,781 143,782 190,783 383,784 179,785 290,786 416,787 499,788 275,789 482,790 418,791 445,792 23,793 432,794 364,795 174,796 328,797 67,798 396,799 78,800 490801 ]802 ],803 "output": 11964804 },805 {806 "input": [807 [808 383062,809 295970,810 824925,811 593850,812 70562,813 86341,814 730776,815 323615,816 206218,817 841019,818 172809,819 256030,820 645635,821 561442,822 832083,823 381521,824 521692,825 322999,826 55224,827 56026,828 412442,829 128659,830 734069,831 534423,832 709414,833 466526,834 452666,835 494189,836 351898,837 498833,838 991296,839 735113,840 145223,841 319188,842 474687,843 23058,844 794685,845 953924,846 96220,847 457219,848 342148,849 260003,850 978641,851 76385,852 411956,853 76487,854 714636,855 408791,856 43997,857 41801,858 322982,859 313679,860 300810,861 262792,862 509510,863 853117,864 579646,865 181960,866 929370,867 884642,868 188650,869 452775,870 227232,871 911617,872 711394,873 938681,874 389824,875 172997,876 34325,877 263032,878 455947,879 422537,880 873813,881 183891882 ],883 [884 405,885 407,886 156,887 137,888 320,889 474,890 421,891 149,892 379,893 420,894 191,895 117,896 401,897 60,898 148,899 442,900 319,901 71,902 342,903 321,904 404,905 88,906 379,907 129,908 446,909 143,910 467,911 137,912 439,913 143,914 11,915 411,916 307,917 125,918 146,919 253,920 311,921 265,922 485,923 233,924 299,925 194,926 257,927 397,928 31,929 478,930 111,931 115,932 195,933 465,934 48,935 9,936 342,937 261,938 344,939 38,940 286,941 492,942 351,943 195,944 259,945 309,946 2,947 120,948 475,949 353,950 412,951 370,952 373,953 401,954 263,955 205,956 339,957 23958 ]959 ],960 "output": 23058961 },962 {963 "input": [964 [965 703636,966 708634,967 94980,968 40938,969 577470,970 696595,971 333731,972 191081,973 130543,974 280587,975 743484,976 350460,977 177591,978 119594,979 899495,980 91410,981 520442,982 19573,983 56790,984 289610,985 957950,986 681849,987 178275,988 549135,989 855718,990 162166,991 480042,992 914072,993 786134,994 317091,995 414645,996 440592,997 474075,998 187627,999 474718,1000 941088,1001 753537,1002 842721,1003 72238,1004 462069,1005 523685,1006 682520,1007 649446,1008 828422,1009 746014,1010 712180,1011 592078,1012 207488,1013 957481,1014 310062,1015 311152,1016 393331,1017 780577,1018 814475,1019 967048,1020 185844,1021 542782,1022 92429,1023 317513,1024 460350,1025 469782,1026 273335,1027 190099,1028 963286,1029 868173,1030 535911,1031 135438,1032 811289,1033 691443,1034 436123,1035 799031,1036 225912,1037 856,1038 972731,1039 615004,1040 635663,1041 479735,1042 423684,1043 899147,1044 622261,1045 446432,1046 391433,1047 428920,1048 105526,1049 997659,1050 313946,1051 454822,1052 834248,1053 65923,1054 650857,1055 134599,1056 930902,1057 767630,1058 143051,1059 669083,1060 861559,1061 12442,1062 854383,1063 979161,1064 989971,1065 144166,1066 750275,1067 280174,1068 349808,1069 29171,1070 534216,1071 682826,1072 154459,1073 626607,1074 2915,1075 470449,1076 496691,1077 7149,1078 514111,1079 746199,1080 782023,1081 378189,1082 742696,1083 961321,1084 441206,1085 879003,1086 125149,1087 403849,1088 654448,1089 677184,1090 312963,1091 907463,1092 730371,1093 504032,1094 60724,1095 871098,1096 959021,1097 906540,1098 706134,1099 257493,1100 935158,1101 109960,1102 518053,1103 796164,1104 869334,1105 303056,1106 531442,1107 747726,1108 159305,1109 826973,1110 956003,1111 11162,1112 65194,1113 96674,1114 696589,1115 132105,1116 995657,1117 28654,1118 470485,1119 643755,1120 492043,1121 176175,1122 131153,1123 609855,1124 3143,1125 593633,1126 589661,1127 414208,1128 704162,1129 878078,1130 487526,1131 891675,1132 91392,1133 666687,1134 340781,1135 694941,1136 461988,1137 556951,1138 449758,1139 851100,1140 402512,1141 145446,1142 640228,1143 929739,1144 252262,1145 529654,1146 554985,1147 240895,1148 444965,1149 837768,1150 277757,1151 765348,1152 961463,1153 315516,1154 909247,1155 576292,1156 592910,1157 213030,1158 513372,1159 933734,1160 605587,1161 815508,1162 485787,1163 60036,1164 612464,1165 980139,1166 297509,1167 910462,1168 647252,1169 351849,1170 95741,1171 259906,1172 629712,1173 618124,1174 995448,1175 599321,1176 163048,1177 945205,1178 339538,1179 426754,1180 242137,1181 900491,1182 233626,1183 641026,1184 342219,1185 747182,1186 237345,1187 308701,1188 533601,1189 16381,1190 470248,1191 969107,1192 235522,1193 56202,1194 78555,1195 251863,1196 927067,1197 918320,1198 297920,1199 505067,1200 949842,