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 |
---|---|---|---|---|---|---|
1989 | Educational Codeforces Round 167 (Rated for Div. 2) | FINISHED | False | 7200 | 17681063 | June 27, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 6177 ) | D | Smithing Skill | PROGRAMMING | brute force dp greedy math sortings two pointers |
B'You are playing a famous computer game (that just works) where you have various skills you can level up. Today, you focused on the "Smithing" skill. Your tactic is obvious: forging weapons from ingots and then melting them back to return the materials partially. For simplicity, every time you create an item, you get 1 experience point, and every time you melt an item, you also get 1 experience point. There are n classes of weapons you can forge and m types of metal ingots. You can create one weapon of the i -th class, spending a_i ingots of metal of the same type. Melting a weapon of the i -th class (which you crafted earlier) returns you b_i ingots of the type of metal it was made of. You have c_j metal ingots of the j -th type, and you know that you can craft a weapon of any class from any metal type. Each combination of a weapon class and a metal type can be used any number of times. What is the maximum total amount of experience you can earn by crafting and melting weapons? The first line contains two integers n and m ( 1 <= n, m <= 10^6 ) -- the number of weapon classes and metal types. The second line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^6 ), where a_i is the number of ingots you need to forge one weapon of the i -th class. The third line contains n integers b_1, b_2, ... , b_n ( 0 <= b_i < a_i ), where b_i is the number of ingots you return by melting one weapon of the i -th class you forged earlier. The fourth line contains m integers c_1, c_2, ... , c_m ( 1 <= c_j <= 10^9 ) -- the number of ingots you have of the corresponding metal type. Print one integer -- the maximum total experience points you can gain by repeatedly forging and melting weapons. In the first example, you can do the following: '... |
Educational Codeforces Round 167 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
267910621 | nemars | D | June 28, 2024, 7:07 p.m. | OK | C# 10 | TESTS | 27 | 703 | 104857600 | ||
267837796 | TrendBattles | D | June 28, 2024, 10:03 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 640 | 16384000 | ||
267837689 | TrendBattles | D | June 28, 2024, 10:02 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 655 | 16384000 | ||
267904749 | Koush_5802 | D | June 28, 2024, 6:15 p.m. | OK | C++14 (GCC 6-32) | TESTS | 27 | 671 | 36454400 | ||
267932754 | __breeze__ | D | June 29, 2024, 1:12 a.m. | OK | C++14 (GCC 6-32) | TESTS | 27 | 671 | 40345600 | ||
267838093 | jiaxingCookie | D | June 28, 2024, 10:05 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 687 | 20070400 | ||
267795031 | yuyc | D | June 28, 2024, 1:51 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 718 | 14643200 | ||
267881742 | ymz2005 | D | June 28, 2024, 3:26 p.m. | OK | C++14 (GCC 6-32) | TESTS | 27 | 733 | 44441600 | ||
267808154 | byebye10000 | D | June 28, 2024, 5:59 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 749 | 15052800 | ||
267933285 | zhuruirong | D | June 29, 2024, 1:25 a.m. | OK | C++14 (GCC 6-32) | TESTS | 27 | 749 | 40140800 | ||
267794034 | liuzimingc | D | June 28, 2024, 1:13 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 764 | 32153600 | ||
267886522 | Dreadwing | D | June 28, 2024, 3:59 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 593 | 12390400 | ||
267881609 | stubborn_1 | D | June 28, 2024, 3:25 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 608 | 12390400 | ||
267920024 | ctcakip | D | June 28, 2024, 8:56 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 608 | 16281600 | ||
267840531 | zeroikyu | D | June 28, 2024, 10:23 a.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 608 | 16896000 | ||
267837385 | amcbn | D | June 28, 2024, 10 a.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 608 | 20070400 | ||
267821554 | Nanako7_ix | D | June 28, 2024, 8:06 a.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 608 | 20582400 | ||
267913127 | miata | D | June 28, 2024, 7:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 609 | 16384000 | ||
267839936 | zeroikyu | D | June 28, 2024, 10:19 a.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 609 | 16896000 | ||
267882143 | _yjhhh | D | June 28, 2024, 3:29 p.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 624 | 8396800 | ||
267821602 | chaar_butternaan | D | June 28, 2024, 8:06 a.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 624 | 12390400 | ||
267876887 | RHEXAOC | D | June 28, 2024, 2:55 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 217 | 41984000 | ||
267921312 | RHEXAOC | D | June 28, 2024, 9:14 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 218 | 41984000 | ||
267876490 | RHEXAOC | D | June 28, 2024, 2:52 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 218 | 41984000 | ||
267846024 | MVP_DukeX | D | June 28, 2024, 11:04 a.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 233 | 16691200 | ||
267920930 | RHEXAOC | D | June 28, 2024, 9:09 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 233 | 41984000 | ||
267875399 | RHEXAOC | D | June 28, 2024, 2:45 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 233 | 41984000 | ||
267921757 | RHEXAOC | D | June 28, 2024, 9:21 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 234 | 41984000 | ||
267875740 | RHEXAOC | D | June 28, 2024, 2:47 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 234 | 41984000 | ||
267921226 | RHEXAOC | D | June 28, 2024, 9:13 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 249 | 41984000 | ||
267921030 | RHEXAOC | D | June 28, 2024, 9:11 p.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 249 | 41984000 | ||
267825731 | minibin | D | June 28, 2024, 8:36 a.m. | OK | Java 21 | TESTS | 26 | 389 | 18329600 | ||
267803309 | minibin | D | June 28, 2024, 5:12 a.m. | OK | Java 21 | TESTS | 26 | 406 | 18636800 | ||
267946629 | minibin | D | June 29, 2024, 4:58 a.m. | OK | Java 21 | TESTS | 27 | 514 | 54374400 | ||
267919647 | Ronak_Ramuka | D | June 28, 2024, 8:50 p.m. | OK | Java 21 | TESTS | 27 | 983 | 77721600 | ||
267919497 | Ronak_Ramuka | D | June 28, 2024, 8:48 p.m. | OK | Java 21 | TESTS | 27 | 1015 | 77926400 | ||
267919236 | susvant | D | June 28, 2024, 8:45 p.m. | OK | Java 21 | TESTS | 27 | 1046 | 45568000 | ||
267899189 | mkah123 | D | June 28, 2024, 5:30 p.m. | OK | Java 21 | TESTS | 27 | 1499 | 63078400 | ||
267901840 | henryz | D | June 28, 2024, 5:52 p.m. | OK | Java 21 | TESTS | 27 | 1562 | 59699200 | ||
267899565 | henryz | D | June 28, 2024, 5:33 p.m. | OK | Java 21 | TESTS | 27 | 1578 | 59904000 | ||
267890879 | lyongwolf | D | June 28, 2024, 4:28 p.m. | OK | Java 21 | TESTS | 27 | 1702 | 87347200 | ||
267870635 | PlayDate | D | June 28, 2024, 2:12 p.m. | OK | Java 8 | TESTS | 27 | 874 | 128102400 | ||
267799416 | om172 | D | June 28, 2024, 4:02 a.m. | OK | Java 8 | TESTS | 26 | 890 | 114585600 | ||
267861928 | nis1234 | D | June 28, 2024, 1:08 p.m. | OK | Java 8 | TESTS | 27 | 952 | 37171200 | ||
267858348 | vatsal_04 | D | June 28, 2024, 12:41 p.m. | OK | Java 8 | TESTS | 27 | 1203 | 117555200 | ||
267949622 | HardikG12 | D | June 29, 2024, 5:34 a.m. | OK | Java 8 | TESTS | 27 | 1217 | 105062400 | ||
267925361 | RandyG | D | June 28, 2024, 10:25 p.m. | OK | Java 8 | TESTS | 27 | 1453 | 109977600 | ||
267886490 | Sumitsingh7 | D | June 28, 2024, 3:59 p.m. | OK | Java 8 | TESTS | 27 | 2749 | 170496000 | ||
267886739 | Sumitsingh7 | D | June 28, 2024, 4 p.m. | OK | Java 8 | TESTS | 27 | 2811 | 170393600 | ||
267886641 | Sumitsingh7 | D | June 28, 2024, 4 p.m. | OK | Java 8 | TESTS | 27 | 2905 | 170598400 | ||
267885122 | Sumitsingh7 | D | June 28, 2024, 3:49 p.m. | OK | Java 8 | TESTS | 27 | 2953 | 170496000 | ||
267947381 | BayernForce | D | June 29, 2024, 5:08 a.m. | OK | Kotlin 1.9 | TESTS | 27 | 2437 | 192614400 | ||
267917384 | pride_._ | D | June 28, 2024, 8:22 p.m. | OK | Kotlin 1.9 | TESTS | 27 | 2515 | 192614400 | ||
267903593 | ShlumBerg | D | June 28, 2024, 6:05 p.m. | OK | Kotlin 1.9 | TESTS | 27 | 2515 | 192614400 | ||
267938610 | hxu10 | D | June 29, 2024, 3:05 a.m. | OK | PyPy 3-64 | TESTS | 27 | 734 | 228044800 | ||
267876676 | LightHouse1 | D | June 28, 2024, 2:54 p.m. | OK | PyPy 3-64 | TESTS | 27 | 749 | 131891200 | ||
267873183 | golomb | D | June 28, 2024, 2:29 p.m. | OK | PyPy 3-64 | TESTS | 27 | 780 | 131993600 | ||
267837041 | dabbler1 | D | June 28, 2024, 9:57 a.m. | OK | PyPy 3-64 | TESTS | 26 | 812 | 219033600 | ||
267795180 | mikeac | D | June 28, 2024, 1:56 a.m. | OK | PyPy 3-64 | TESTS | 26 | 843 | 165990400 | ||
267865364 | tlsgusrb314 | D | June 28, 2024, 1:34 p.m. | OK | PyPy 3-64 | TESTS | 27 | 843 | 181248000 | ||
267802129 | fermion5 | D | June 28, 2024, 4:57 a.m. | OK | PyPy 3-64 | TESTS | 26 | 858 | 163737600 | ||
267875257 | scyyyyyyyyyy | D | June 28, 2024, 2:44 p.m. | OK | PyPy 3-64 | TESTS | 27 | 859 | 165683200 | ||
267806957 | gsomani | D | June 28, 2024, 5:50 a.m. | OK | PyPy 3-64 | TESTS | 26 | 874 | 171520000 | ||
267880004 | shubham6105 | D | June 28, 2024, 3:15 p.m. | OK | PyPy 3-64 | TESTS | 27 | 874 | 175206400 | ||
267888186 | Rohith_32432 | D | June 28, 2024, 4:10 p.m. | OK | Python 3 | TESTS | 27 | 2577 | 207769600 | ||
267850060 | Lehan_peddineni | D | June 28, 2024, 11:37 a.m. | OK | Python 3 | TESTS | 26 | 2781 | 205926400 | ||
267844812 | 2100032409 | D | June 28, 2024, 10:55 a.m. | OK | Python 3 | TESTS | 26 | 2812 | 205107200 | ||
267831068 | 2100030468 | D | June 28, 2024, 9:13 a.m. | OK | Python 3 | TESTS | 26 | 2812 | 205107200 | ||
267831192 | 2100030468 | D | June 28, 2024, 9:14 a.m. | OK | Python 3 | TESTS | 26 | 2984 | 205926400 | ||
267828389 | BetterThanNobita | D | June 28, 2024, 8:55 a.m. | OK | Rust 2021 | TESTS | 26 | 124 | 32460800 | ||
267916355 | vstiff | D | June 28, 2024, 8:09 p.m. | OK | Rust 2021 | TESTS | 27 | 265 | 49561600 | ||
267821595 | BetterThanNobita | D | June 28, 2024, 8:06 a.m. | OK | Rust 2021 | TESTS | 26 | 312 | 73625600 | ||
267822058 | BetterThanNobita | D | June 28, 2024, 8:09 a.m. | OK | Rust 2021 | TESTS | 26 | 327 | 73625600 | ||
267821428 | liut | D | June 28, 2024, 8:05 a.m. | OK | Rust 2021 | TESTS | 26 | 374 | 44441600 | ||
267796130 | strokeme | D | June 28, 2024, 2:27 a.m. | OK | Rust 2021 | TESTS | 26 | 718 | 121651200 | ||
267861060 | maomao90 | D | June 28, 2024, 1:02 p.m. | OK | Rust 2021 | TESTS | 27 | 968 | 125644800 |
Back to search problems