Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1814 | Educational Codeforces Round 146 (Rated for Div. 2) | FINISHED | False | 8100 | 56388263 | April 6, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 895 ) | D | Balancing Weapons | PROGRAMMING | binary search brute force two pointers |
B"You've got a job in a game studio that developed an online shooter, and your first big task is to help to balance weapons. The game has n weapons: the i -th gun has an integer fire rate f_i and an integer damage per bullet d_i . The i -th gun's total firepower is equal to p_i = f_i cdot d_i . You have to modify the values d_i of some guns in such a way that the new values d_i will still be integers, and the firepower of all guns will become balanced. Given an integer k , the guns are said to be balanced if max limits_{1 <= i <= n}{p_i} - min limits_{1 <= i <= n}{p_i} <= k . Since gamers that play your game don't like big changes, you need to change the values d_i for the minimum possible number of guns. What is the minimum number of guns for which you have to change these values to make the guns balanced? Note that the new values d_i must be integers greater than 0 . The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The first line of each test case contains two integers n and k ( 2 <= n <= 3000 ; 0 <= k <= 1500 ) -- the number of guns to balance, and the maximum allowed gap between the most and the least powerful weapons. The second line contains n integers f_1, f_2, ... , f_n ( 1 <= f_i <= 2000 ), where f_i is the fire rate of the i -th gun. The third line contains n integers d_1, d_2, ... , d_n ( 1 <= d_i <= 10^9 ), where d_i is the damage per bullet of the i -th gun. It's guaranteed that the sum of n over all test cases doesn't exceed 3000 . For each test case, print the minimum number of guns which damage d_i you have to change in order to make the guns balanced. Note that the new values d_i must be integers greater than 0 . In the first test case, you can set d_1 = 2 and d_2 = 4 . You'll get an a"... |
Educational Codeforces Round 146 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
201057565 | Splashing | D | April 6, 2023, 5:22 p.m. | OK | GNU C++14 | TESTS | 12 | 31 | 102400 | ||
201077454 | omeganot | D | April 6, 2023, 9:11 p.m. | OK | GNU C++14 | TESTS | 12 | 296 | 102400 | ||
201089060 | DitaMirika | D | April 7, 2023, 2:05 a.m. | OK | GNU C++14 | TESTS | 12 | 483 | 72601600 | ||
201092386 | High_Score | D | April 7, 2023, 3:23 a.m. | OK | GNU C++14 | TESTS | 12 | 795 | 1126400 | ||
201088378 | ekatsim | D | April 7, 2023, 1:49 a.m. | OK | GNU C++14 | TESTS | 12 | 1715 | 102400 | ||
201063287 | SergiiGolovko | D | April 6, 2023, 6:19 p.m. | OK | GNU C++14 | TESTS | 12 | 2011 | 512000 | ||
201063065 | SergiiGolovko | D | April 6, 2023, 6:17 p.m. | OK | GNU C++14 | TESTS | 12 | 2012 | 512000 | ||
201062073 | SergiiGolovko | D | April 6, 2023, 6:07 p.m. | OK | GNU C++14 | TESTS | 12 | 2028 | 512000 | ||
201049467 | ahmao | D | April 6, 2023, 4:35 p.m. | OK | GNU C++14 | TESTS | 12 | 2370 | 6348800 | ||
201091567 | include_BM | D | April 7, 2023, 3:06 a.m. | OK | GNU C++14 | TESTS | 12 | 2652 | 9011200 | ||
201056931 | mc020207 | D | April 6, 2023, 5:17 p.m. | OK | GNU C++17 | TESTS | 12 | 15 | 24064000 | ||
201077768 | regain0002 | D | April 6, 2023, 9:16 p.m. | OK | GNU C++17 | TESTS | 12 | 78 | 204800 | ||
201065832 | lddlinan | D | April 6, 2023, 6:47 p.m. | OK | GNU C++17 | TESTS | 12 | 78 | 204800 | ||
201093937 | a757403 | D | April 7, 2023, 3:56 a.m. | OK | GNU C++17 | TESTS | 12 | 156 | 102400 | ||
201100116 | Solashiro | D | April 7, 2023, 5:38 a.m. | OK | GNU C++17 | TESTS | 12 | 187 | 102400 | ||
201062656 | DeadlyPillow | D | April 6, 2023, 6:12 p.m. | OK | GNU C++17 | TESTS | 12 | 202 | 204800 | ||
201049827 | rheallyc | D | April 6, 2023, 4:37 p.m. | OK | GNU C++17 | TESTS | 12 | 265 | 1945600 | ||
201061286 | gustavoleal | D | April 6, 2023, 5:58 p.m. | OK | GNU C++17 | TESTS | 12 | 280 | 37580800 | ||
201100583 | sunhokim | D | April 7, 2023, 5:44 a.m. | OK | GNU C++17 | TESTS | 12 | 296 | 102400 | ||
201097467 | Hritik12 | D | April 7, 2023, 5 a.m. | OK | GNU C++17 | TESTS | 12 | 296 | 102400 | ||
201053570 | swagchicken | D | April 6, 2023, 4:52 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 155 | 409600 | ||
201059504 | lgkm39 | D | April 6, 2023, 5:40 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 156 | 102400 | ||
201063724 | Lucina | D | April 6, 2023, 6:23 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 156 | 32051200 | ||
201085313 | ahey | D | April 7, 2023, 12:27 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 171 | 102400 | ||
201068809 | MarcosK | D | April 6, 2023, 7:22 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 171 | 102400 | ||
201063580 | Lucina | D | April 6, 2023, 6:22 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 171 | 32051200 | ||
201062726 | Lucina | D | April 6, 2023, 6:13 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 171 | 32051200 | ||
201044681 | kotatsugame | D | April 6, 2023, 4:17 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 186 | 102400 | ||
201094245 | Zeardoe | D | April 7, 2023, 4:03 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 295 | 4710400 | ||
201058760 | AmirAli-Asgari | D | April 6, 2023, 5:33 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 296 | 307200 | ||
201048520 | MvKaio | D | April 6, 2023, 4:32 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 31 | 102400 | ||
201067253 | MISM06 | D | April 6, 2023, 7:04 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 102400 | ||
201060535 | 200815147 | D | April 6, 2023, 5:51 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 102400 | ||
201093125 | wjh666 | D | April 7, 2023, 3:39 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 108 | 102400 | ||
201058187 | BurnedChicken | D | April 6, 2023, 5:28 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 109 | 102400 | ||
201063964 | zzpcd | D | April 6, 2023, 6:26 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 124 | 102400 | ||
201079738 | piyush_pransukhka | D | April 6, 2023, 10:18 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 124 | 512000 | ||
201059142 | abc864197532 | D | April 6, 2023, 5:36 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 140 | 204800 | ||
201073949 | Alfeh | D | April 6, 2023, 8:28 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 140 | 3584000 | ||
201098501 | aibark | D | April 7, 2023, 5:15 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 156 | 102400 | ||
201051493 | Dukkha | D | April 6, 2023, 4:44 p.m. | OK | Java 17 | TESTS | 12 | 2464 | 0 | ||
201052668 | Dukkha | D | April 6, 2023, 4:48 p.m. | OK | Java 17 | TESTS | 12 | 2526 | 204800 | ||
201064522 | golions | D | April 6, 2023, 6:31 p.m. | OK | Java 8 | TESTS | 12 | 748 | 0 | ||
201066390 | golions | D | April 6, 2023, 6:54 p.m. | OK | Java 8 | TESTS | 12 | 779 | 0 | ||
201066460 | golions | D | April 6, 2023, 6:55 p.m. | OK | Java 8 | TESTS | 12 | 810 | 0 | ||
201066553 | golions | D | April 6, 2023, 6:56 p.m. | OK | Java 8 | TESTS | 12 | 826 | 0 | ||
201080485 | codicon | D | April 6, 2023, 10:35 p.m. | OK | PyPy 3-64 | TESTS | 12 | 638 | 11878400 | ||
201089811 | Little_Sheep_Yawn | D | April 7, 2023, 2:28 a.m. | OK | PyPy 3-64 | TESTS | 12 | 701 | 13312000 | ||
201084815 | nikgaevoy | D | April 7, 2023, 12:14 a.m. | OK | Rust 2021 | TESTS | 12 | 2386 | 716800 |
Back to search problems