Codeforces Round 888 (Div. 3)

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
1851 Codeforces Round 888 (Div. 3) FINISHED False 8100 46884263 July 25, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10797 ) E Nastya and Potions PROGRAMMING dfs and similar dp graphs greedy shortest paths sortings

B"Alchemist Nastya loves mixing potions. There are a total of n types of potions, and one potion of type i can be bought for c_i coins. Any kind of potions can be obtained in no more than one way, by mixing from several others. The potions used in the mixing process will be consumed. Moreover, no potion can be obtained from itself through one or more mixing processes. As an experienced alchemist, Nastya has an unlimited supply of k types of potions p_1, p_2, ... , p_k , but she doesn't know which one she wants to obtain next. To decide, she asks you to find, for each 1 <= i <= n , the minimum number of coins she needs to spend to obtain a potion of type i next. The first line of each test contains an integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Each test case is described as follows: The first line contains two integers n and k ( 1 <= k < n <= 2 cdot 10^5 ) -- the total number of potion types and the number of potion types Nastya already has. The second line contains n integers c_1, c_2, ... , c_n ( 1 <= c_i <= 10^9 ) -- the costs of buying the potions. The third line contains k distinct integers p_1, p_2, ... , p_k ( 1 <= p_i <= n ) -- the indices of potions Nastya already has an unlimited supply of. This is followed by n lines describing ways to obtain potions by mixing. Each line starts with the integer m_i ( 0 <= m_i < n ) -- the number of potions required to mix a potion of the type i ( 1 <= i <= n ). Then line contains m_i distinct integers e_1, e_2, ... , e_{m_i} ( 1 <= e_j <= n , e_j ne i ) -- the indices of potions needed to mix a potion of the type i . If this list is empty, then a potion of the type i can only be bought. It is guaranteed that no potion can be obtained from itself through one or more mixing processes. It is guaranteed that the sum of"...

Tutorials

118667

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
215658427 soumyadebs22 E July 26, 2023, 1:19 a.m. OK GNU C11 TESTS 13 1076 9011200
215665757 sacave E July 26, 2023, 2:56 a.m. OK GNU C++14 TESTS 13 186 7987200
215678508 xizhao E July 26, 2023, 5:37 a.m. OK GNU C++14 TESTS 13 186 8499200
215630231 The-Winner E July 25, 2023, 5:44 p.m. OK GNU C++14 TESTS 13 187 7680000
215623996 kuguadawang E July 25, 2023, 5:06 p.m. OK GNU C++14 TESTS 13 187 10035200
215632691 Leyan_Robaina E July 25, 2023, 6:04 p.m. OK GNU C++14 TESTS 13 202 9216000
215667898 zhenikun E July 26, 2023, 3:20 a.m. OK GNU C++14 TESTS 13 202 9318400
215667548 JIUJIU9 E July 26, 2023, 3:17 a.m. OK GNU C++14 TESTS 13 202 9420800
215674750 T0p_ E July 26, 2023, 4:51 a.m. OK GNU C++14 TESTS 13 202 9523200
215676402 Prantiq_103 E July 26, 2023, 5:12 a.m. OK GNU C++14 TESTS 13 202 11059200
215679717 karansrivastava E July 26, 2023, 5:51 a.m. OK GNU C++14 TESTS 13 202 11264000
215625301 kapishv E July 25, 2023, 5:12 p.m. OK GNU C++17 TESTS 13 187 7884800
215627582 Matthew_hpg E July 25, 2023, 5:26 p.m. OK GNU C++17 TESTS 13 187 9318400
215627533 AAKASH19 E July 25, 2023, 5:25 p.m. OK GNU C++17 TESTS 13 187 9420800
215622450 Finral_eCia E July 25, 2023, 4:59 p.m. OK GNU C++17 TESTS 13 187 9420800
215679637 surya535 E July 26, 2023, 5:50 a.m. OK GNU C++17 TESTS 13 187 9420800
215645124 sky_full_of_stars E July 25, 2023, 8:31 p.m. OK GNU C++17 TESTS 13 187 9523200
215639682 risel E July 25, 2023, 7:15 p.m. OK GNU C++17 TESTS 13 187 10956800
215666773 hjing E July 26, 2023, 3:07 a.m. OK GNU C++17 TESTS 13 187 15052800
215637828 YuriyKap E July 25, 2023, 6:53 p.m. OK GNU C++17 TESTS 13 187 15360000
215625138 G_bg E July 25, 2023, 5:11 p.m. OK GNU C++17 TESTS 13 202 6656000
215650297 OmarW E July 25, 2023, 9:54 p.m. OK GNU C++17 (64) TESTS 13 140 10137600
215652908 rumman_sust E July 25, 2023, 10:58 p.m. OK GNU C++17 (64) TESTS 13 140 11776000
215638873 SandAuddy755 E July 25, 2023, 7:07 p.m. OK GNU C++17 (64) TESTS 13 140 12902400
215638086 MAGIC_PEACH E July 25, 2023, 6:56 p.m. OK GNU C++17 (64) TESTS 13 140 14131200
215665213 oath0925 E July 26, 2023, 2:50 a.m. OK GNU C++17 (64) TESTS 13 155 11264000
215624527 dani_pereira E July 25, 2023, 5:08 p.m. OK GNU C++17 (64) TESTS 13 155 12595200
215667707 coding_happy E July 26, 2023, 3:18 a.m. OK GNU C++17 (64) TESTS 13 155 13824000
215679595 coding_happy E July 26, 2023, 5:50 a.m. OK GNU C++17 (64) TESTS 13 155 13824000
215630275 oogerbooger E July 25, 2023, 5:44 p.m. OK GNU C++17 (64) TESTS 13 155 20275200
215665044 oath0925 E July 26, 2023, 2:48 a.m. OK GNU C++17 (64) TESTS 13 155 31027200
215678941 new_wh E July 26, 2023, 5:42 a.m. OK GNU C++20 (64) TESTS 13 108 10342400
215672079 baile E July 26, 2023, 4:13 a.m. OK GNU C++20 (64) TESTS 13 108 10342400
215659884 qqmy0220 E July 26, 2023, 1:40 a.m. OK GNU C++20 (64) TESTS 13 109 8089600
215668976 tahmidarefin E July 26, 2023, 3:34 a.m. OK GNU C++20 (64) TESTS 13 109 9523200
215642058 REMAINDoER E July 25, 2023, 7:45 p.m. OK GNU C++20 (64) TESTS 13 109 10240000
215664794 Jerry20110434 E July 26, 2023, 2:45 a.m. OK GNU C++20 (64) TESTS 13 109 10444800
215663296 hy-phantom E July 26, 2023, 2:27 a.m. OK GNU C++20 (64) TESTS 13 109 11366400
215669800 iwew E July 26, 2023, 3:45 a.m. OK GNU C++20 (64) TESTS 13 109 11673600
215675719 Ultimus007 E July 26, 2023, 5:03 a.m. OK GNU C++20 (64) TESTS 13 109 11878400
215623362 Eunoiay E July 25, 2023, 5:03 p.m. OK GNU C++20 (64) TESTS 13 109 11878400
215643814 Edge_Tree E July 25, 2023, 8:14 p.m. OK Java 11 TESTS 13 452 89292800
215671732 InfinitePath E July 26, 2023, 4:08 a.m. OK Java 11 TESTS 13 452 89292800
215646429 Yousef_Badr E July 25, 2023, 8:49 p.m. OK Java 11 TESTS 13 467 28262400
215637694 kushwaha_vi E July 25, 2023, 6:52 p.m. OK Java 11 TESTS 13 717 51609600
215639402 princeayush04 E July 25, 2023, 7:12 p.m. OK Java 11 TESTS 13 841 56422400
215675223 dark_rays E July 26, 2023, 4:57 a.m. OK Java 11 TESTS 13 842 92262400
215627012 themadknight45 E July 25, 2023, 5:22 p.m. OK Java 11 TESTS 13 842 92262400
215630095 butteronpoptart E July 25, 2023, 5:43 p.m. OK Java 11 TESTS 13 1091 23552000
215646629 PlayDate E July 25, 2023, 8:52 p.m. OK Java 11 TESTS 13 1684 19251200
215622105 Utsav82 E July 25, 2023, 4:58 p.m. OK Java 17 TESTS 13 452 34918400
215623844 lapisliu E July 25, 2023, 5:05 p.m. OK Java 17 TESTS 13 514 27648000
215628421 vermadv2000 E July 25, 2023, 5:32 p.m. OK Java 17 TESTS 13 514 40038400
215640600 Hawater E July 25, 2023, 7:26 p.m. OK Java 17 TESTS 13 608 60108800
215661211 kkz666 E July 26, 2023, 1:59 a.m. OK Java 17 TESTS 13 623 28467200
215624496 vermadv2000 E July 25, 2023, 5:08 p.m. OK Java 17 TESTS 13 655 39424000
215625265 miminguci E July 25, 2023, 5:12 p.m. OK Java 17 TESTS 13 748 67891200
215639414 mcrash12 E July 25, 2023, 7:12 p.m. OK Java 17 TESTS 13 1216 43315200
215637553 Abdelrahim303 E July 25, 2023, 6:50 p.m. OK Java 17 TESTS 13 1216 56729600
215675114 jiangqiao E July 26, 2023, 4:56 a.m. OK Java 17 TESTS 13 1840 92774400
215644858 NerfThis E July 25, 2023, 8:27 p.m. OK Java 8 TESTS 13 280 12185600
215677560 bleach__ E July 26, 2023, 5:25 a.m. OK Java 8 TESTS 13 296 106598400
215629065 leonlian E July 25, 2023, 5:36 p.m. OK Java 8 TESTS 13 389 31846400
215620225 lj1474 E July 25, 2023, 4:52 p.m. OK Java 8 TESTS 13 1325 74956800
215675206 FeehamSzYr E July 26, 2023, 4:57 a.m. OK Java 8 TESTS 13 1606 43110400
215652426 maxK99 E July 25, 2023, 10:45 p.m. OK MS C++ 2017 TESTS 13 624 9011200
215627594 LHamster E July 25, 2023, 5:26 p.m. OK MS C++ 2017 TESTS 13 639 10444800
215647091 Voz56 E July 25, 2023, 8:58 p.m. OK MS C++ 2017 TESTS 13 670 16076800
215621986 30SK5 E July 25, 2023, 4:57 p.m. OK MS C++ 2017 TESTS 13 733 17920000
215650631 lebron87 E July 25, 2023, 10:01 p.m. OK PyPy 3 TESTS 13 826 38195200
215638413 damya E July 25, 2023, 7:01 p.m. OK PyPy 3-64 TESTS 13 390 46592000
215628396 person_exe E July 25, 2023, 5:31 p.m. OK PyPy 3-64 TESTS 13 405 39014400
215635266 kg26__ E July 25, 2023, 6:26 p.m. OK PyPy 3-64 TESTS 13 405 61849600
215670726 RobinFromTheHood E July 26, 2023, 3:56 a.m. OK PyPy 3-64 TESTS 13 405 179302400
215655734 RobinFromTheHood E July 26, 2023, 12:23 a.m. OK PyPy 3-64 TESTS 13 405 247603200
215642274 RobinFromTheHood E July 25, 2023, 7:48 p.m. OK PyPy 3-64 TESTS 13 420 48230400
215670414 RobinFromTheHood E July 26, 2023, 3:52 a.m. OK PyPy 3-64 TESTS 13 421 178790400
215676356 2momo2 E July 26, 2023, 5:11 a.m. OK PyPy 3-64 TESTS 13 421 179916800
215651889 KanishkGoel E July 25, 2023, 10:32 p.m. OK PyPy 3-64 TESTS 13 436 61849600
215655044 RobinFromTheHood E July 26, 2023, 12:04 a.m. OK PyPy 3-64 TESTS 13 436 182681600
215678916 MistaFlash E July 26, 2023, 5:42 a.m. OK Python 3 TESTS 13 904 142745600
215678172 deepansh09 E July 26, 2023, 5:32 a.m. OK Python 3 TESTS 13 935 147660800
215628282 person_exe E July 25, 2023, 5:31 p.m. OK Python 3 TESTS 13 1044 43827200
215632454 2am E July 25, 2023, 6:02 p.m. OK Python 3 TESTS 13 1060 45875200
215628367 person_exe E July 25, 2023, 5:31 p.m. OK Python 3 TESTS 13 1106 43827200
215665769 gr8den E July 26, 2023, 2:56 a.m. OK Rust 2021 TESTS 13 139 31027200
215666398 gr8den E July 26, 2023, 3:03 a.m. OK Rust 2021 TESTS 13 139 31436800

remove filters

Back to search problems