Codeforces Round 510 (Div. 2)

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
1042 Codeforces Round 510 (Div. 2) FINISHED False 7200 200008462 Sept. 17, 2018, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 16667 ) B Vitamins PROGRAMMING bitmasks brute force dp implementation 1200

B'Berland shop sells n kinds of juices. Each juice has its price c_i . Each juice includes some set of vitamins in it. There are three types of vitamins: vitamin "A", vitamin "B" and vitamin "C". Each juice can contain one, two or all three types of vitamins in it. Petya knows that he needs all three types of vitamins to stay healthy. What is the minimum total price of juices that Petya has to buy to obtain all three vitamins? Petya obtains some vitamin if he buys at least one juice containing it and drinks it. The first line contains a single integer n (1 <= n <= 1 ,000) -- the number of juices. Each of the next n lines contains an integer c_i (1 <= c_i <= 100 ,000) and a string s_i -- the price of the i -th juice and the vitamins it contains. String s_i contains from 1 to 3 characters, and the only possible characters are "A", "B" and "C". It is guaranteed that each letter appears no more than once in each string s_i . The order of letters in strings s_i is arbitrary. Print -1 if there is no way to obtain all three vitamins. Otherwise print the minimum total price of juices that Petya has to buy to obtain all three vitamins. In the first example Petya buys the first, the second and the fourth juice. He spends 5 + 6 + 4 = 15 and obtains all three vitamins. He can also buy just the third juice and obtain three vitamins, but its cost is 16 , which isn 't optimal. In the second example Petya can 't obtain all three vitamins, as no juice contains vitamin "C". '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
43776067 HannahGrace B Oct. 4, 2018, 8:51 a.m. OK Clang++17 Diagnostics TESTS 49 46 0 1200
44835055 AshutoshAnshul B Oct. 25, 2018, 10:28 a.m. OK Clang++17 Diagnostics TESTS 49 61 307200 1200
59370195 binarycode B Aug. 23, 2019, 6:46 p.m. OK Clang++17 Diagnostics TESTS 49 62 0 1200
48035352 NewbieMisis B Jan. 6, 2019, 3:07 p.m. OK FPC TESTS 49 31 102400 1200
58650774 Craspedacusta B Aug. 12, 2019, 7:24 a.m. OK FPC TESTS 49 31 102400 1200
58654816 LaSWeeG B Aug. 12, 2019, 8:44 a.m. OK FPC TESTS 49 31 102400 1200
43717285 ZuZKho B Oct. 3, 2018, 8 a.m. OK FPC TESTS 49 31 102400 1200
45440686 ilya_kas B Nov. 8, 2018, 10:58 a.m. OK FPC TESTS 49 31 102400 1200
46528511 leedinh B Dec. 3, 2018, 2:01 a.m. OK FPC TESTS 49 31 102400 1200
54806356 minhkha B May 29, 2019, 2:22 p.m. OK FPC TESTS 49 31 409600 1200
47173750 dlightny B Dec. 17, 2018, 4:24 p.m. OK FPC TESTS 49 61 2457600 1200
43556582 Shajib_ B Sept. 29, 2018, 6:29 a.m. OK GNU C11 TESTS 49 31 0 1200
56720268 patilc125 B July 8, 2019, 4:28 p.m. OK GNU C11 TESTS 49 31 0 1200
48455507 NoSoul B Jan. 16, 2019, 12:30 p.m. OK GNU C11 TESTS 49 31 0 1200
46921729 solver7 B Dec. 12, 2018, 5:30 a.m. OK GNU C11 TESTS 49 31 0 1200
44440354 karam123 B Oct. 17, 2018, 11:51 a.m. OK GNU C11 TESTS 49 31 0 1200
69533478 ndaidemf B Jan. 25, 2020, 5:56 p.m. OK GNU C11 TESTS 49 31 0 1200
43015157 sparsh_123 B Sept. 17, 2018, 9:54 p.m. OK GNU C11 TESTS 49 31 0 1200
43004633 LEGENDARY174 B Sept. 17, 2018, 3:18 p.m. OK GNU C11 TESTS 49 31 0 1200
42990531 nishantwrp B Sept. 17, 2018, 10 a.m. OK GNU C11 TESTS 49 31 0 1200
42985591 ljnk975 B Sept. 17, 2018, 9:23 a.m. OK GNU C11 TESTS 49 31 0 1200
67580595 LinkCutTree B Dec. 25, 2019, 5:50 a.m. OK GNU C++11 TESTS 49 30 0 1200
43047266 Shaad7 B Sept. 18, 2018, 6:48 p.m. OK GNU C++11 TESTS 49 30 0 1200
43006157 16321 B Sept. 17, 2018, 4 p.m. OK GNU C++11 TESTS 49 30 0 1200
42991119 madiyar99 B Sept. 17, 2018, 10:03 a.m. OK GNU C++11 TESTS 49 30 0 1200
42984853 zx081325 B Sept. 17, 2018, 9:19 a.m. OK GNU C++11 TESTS 49 30 102400 1200
42985864 Chloristendika B Sept. 17, 2018, 9:25 a.m. OK GNU C++11 TESTS 49 30 102400 1200
43031094 godspeedcurry B Sept. 18, 2018, 11:42 a.m. OK GNU C++11 TESTS 49 30 409600 1200
51368166 basel-99 B March 16, 2019, 10:43 a.m. OK GNU C++11 TESTS 49 30 4915200 1200
69886261 gabe B Jan. 31, 2020, 8:19 a.m. OK GNU C++11 TESTS 49 31 0 1200
69890863 cor001 B Jan. 31, 2020, 9:57 a.m. OK GNU C++11 TESTS 49 31 0 1200
69268182 abhiaps B Jan. 21, 2020, 7:29 p.m. OK GNU C++14 TESTS 49 15 0 1200
48061643 Pbicem B Jan. 7, 2019, 3:38 p.m. OK GNU C++14 TESTS 49 15 0 1200
49919310 amitnsky B Feb. 14, 2019, 5:56 p.m. OK GNU C++14 TESTS 49 15 0 1200
50609631 Arturoku B Feb. 28, 2019, 4:16 p.m. OK GNU C++14 TESTS 49 15 0 1200
53827740 monty99 B May 6, 2019, 5:26 p.m. OK GNU C++14 TESTS 49 15 0 1200
54845101 Anunay1605 B May 30, 2019, 1:29 p.m. OK GNU C++14 TESTS 49 15 0 1200
54891525 elabensaad B May 31, 2019, 8:49 p.m. OK GNU C++14 TESTS 49 15 0 1200
56296861 Sayem B June 30, 2019, 6:32 a.m. OK GNU C++14 TESTS 49 15 0 1200
61972382 soimportant B Oct. 6, 2019, 9:27 a.m. OK GNU C++14 TESTS 49 15 0 1200
47891253 m.hasan01 B Jan. 4, 2019, 6:45 a.m. OK GNU C++14 TESTS 49 15 0 1200
65763244 chiriac B Nov. 26, 2019, 4:45 p.m. OK GNU C++17 TESTS 49 15 0 1200
68392241 Raghav9352 B Jan. 8, 2020, 9:13 a.m. OK GNU C++17 TESTS 49 15 0 1200
57836745 sonianand966 B July 27, 2019, 7:50 a.m. OK GNU C++17 TESTS 49 15 0 1200
54233557 atulk0909 B May 16, 2019, 9:44 a.m. OK GNU C++17 TESTS 49 15 0 1200
53597590 vjudge4 B May 1, 2019, 5:39 a.m. OK GNU C++17 TESTS 49 15 0 1200
52470982 MDenes B April 7, 2019, 6:33 p.m. OK GNU C++17 TESTS 49 15 0 1200
52299056 bu_hridoy B April 4, 2019, 7:58 a.m. OK GNU C++17 TESTS 49 15 0 1200
50804902 Anmol B March 5, 2019, 4:29 a.m. OK GNU C++17 TESTS 49 15 0 1200
47040105 ISHV B Dec. 15, 2018, 2:17 p.m. OK GNU C++17 TESTS 49 15 0 1200
57312079 squidward B July 19, 2019, 6:52 a.m. OK GNU C++17 TESTS 49 15 102400 1200
69232159 vjudge1 B Jan. 21, 2020, 9:55 a.m. OK Go TESTS 49 31 0 1200
69232114 synapse B Jan. 21, 2020, 9:54 a.m. OK Go TESTS 49 46 0 1200
43671735 Gansito144 B Oct. 2, 2018, 5:06 a.m. OK Go TESTS 49 61 0 1200
43006001 Haar B Sept. 17, 2018, 3:55 p.m. OK Haskell TESTS 49 31 8499200 1200
68972854 shubh_jha98 B Jan. 17, 2020, 7:41 a.m. OK Java 11 TESTS 49 218 0 1200
65883328 samuelbohl B Nov. 27, 2019, 8:18 p.m. OK Java 11 TESTS 49 248 0 1200
67952084 insane_28 B Dec. 30, 2019, 8:06 a.m. OK Java 8 TESTS 49 109 0 1200
67583690 adzi B Dec. 25, 2019, 7:19 a.m. OK Java 8 TESTS 49 109 0 1200
63392304 Raj9400 B Oct. 25, 2019, 3:36 p.m. OK Java 8 TESTS 49 109 0 1200
48568643 sundarcj B Jan. 19, 2019, 10:55 a.m. OK Java 8 TESTS 49 109 0 1200
48082484 Bibhuti B Jan. 8, 2019, 8:55 a.m. OK Java 8 TESTS 49 109 0 1200
47447251 viratK B Dec. 24, 2018, 7:11 a.m. OK Java 8 TESTS 49 109 0 1200
45652161 donli B Nov. 13, 2018, 2:38 a.m. OK Java 8 TESTS 49 109 0 1200
45391591 motawfik B Nov. 6, 2018, 10:03 p.m. OK Java 8 TESTS 49 109 0 1200
68993277 CecilioG B Jan. 17, 2020, 4:10 p.m. OK Java 8 TESTS 49 124 0 1200
68844128 Juniper B Jan. 15, 2020, 6:50 a.m. OK Java 8 TESTS 49 124 0 1200
44389937 divya B Oct. 16, 2018, 8 a.m. OK JavaScript TESTS 49 46 512000 1200
43358470 NguyenHungCuong B Sept. 24, 2018, 7:49 a.m. OK JavaScript TESTS 49 46 614400 1200
43550922 pranaydutta89 B Sept. 28, 2018, 11:59 p.m. OK JavaScript TESTS 49 46 716800 1200
42985108 NguyenHungCuong B Sept. 17, 2018, 9:20 a.m. OK JavaScript TESTS 49 46 819200 1200
43018313 NguyenHungCuong B Sept. 18, 2018, 2:04 a.m. OK JavaScript TESTS 49 46 819200 1200
45196985 BergP B Nov. 2, 2018, 7:43 a.m. OK Kotlin TESTS 49 140 0 1200
43023367 tumoyakov B Sept. 18, 2018, 7 a.m. OK Kotlin TESTS 49 202 921600 1200
55096065 og.kostya B June 4, 2019, 5:14 p.m. OK Mono C# TESTS 49 46 204800 1200
43045785 lehapenza B Sept. 18, 2018, 5:58 p.m. OK Mono C# TESTS 49 61 102400 1200
50858912 amit1509kumar B March 5, 2019, 5:37 p.m. OK Mono C# TESTS 49 62 102400 1200
42988800 Strelokask B Sept. 17, 2018, 9:48 a.m. OK Mono C# TESTS 49 62 204800 1200
44185371 fastnoise B Oct. 12, 2018, 12:57 p.m. OK Mono C# TESTS 49 62 3686400 1200
43094413 silvavelosa B Sept. 19, 2018, 9:30 p.m. OK Mono C# TESTS 49 62 3788800 1200
48360529 tamunsio B Jan. 13, 2019, 6:25 p.m. OK Mono C# TESTS 49 62 3891200 1200
43035458 jainchethan87 B Sept. 18, 2018, 1:26 p.m. OK Mono C# TESTS 49 62 3993600 1200
42985160 eki B Sept. 17, 2018, 9:21 a.m. OK Mono C# TESTS 49 77 102400 1200
43656484 afga B Oct. 1, 2018, 6:04 p.m. OK Mono C# TESTS 49 93 3891200 1200
66484928 vjudge1 B Dec. 8, 2019, 5:49 a.m. OK MS C++ TESTS 49 30 0 1200
43158745 Vertex10 B Sept. 20, 2018, 10:15 p.m. OK MS C++ TESTS 49 30 0 1200
43007074 lqv111996 B Sept. 17, 2018, 4:29 p.m. OK MS C++ TESTS 49 30 0 1200
43527851 vjudge3 B Sept. 28, 2018, 12:14 p.m. OK MS C++ TESTS 49 30 307200 1200
66490415 vjudge1 B Dec. 8, 2019, 8:21 a.m. OK MS C++ TESTS 49 31 0 1200
66484769 vjudge1 B Dec. 8, 2019, 5:44 a.m. OK MS C++ TESTS 49 31 0 1200
69952536 vjudge1 B Feb. 1, 2020, 9:19 a.m. OK MS C++ TESTS 49 31 0 1200
66489476 vjudge2 B Dec. 8, 2019, 7:57 a.m. OK MS C++ TESTS 49 31 0 1200
66487990 vjudge2 B Dec. 8, 2019, 7:21 a.m. OK MS C++ TESTS 49 31 0 1200
66486629 vjudge5 B Dec. 8, 2019, 6:42 a.m. OK MS C++ TESTS 49 31 0 1200
52075905 viajero B March 31, 2019, 9:59 a.m. OK MS C++ 2017 TESTS 49 31 0 1200
60025511 Still_Theory B Sept. 4, 2019, 2:05 p.m. OK MS C++ 2017 TESTS 49 31 0 1200
60944739 VladKozin B Sept. 20, 2019, 6:25 p.m. OK MS C++ 2017 TESTS 49 31 0 1200
66486009 vjudge4 B Dec. 8, 2019, 6:23 a.m. OK MS C++ 2017 TESTS 49 31 0 1200
53285296 1708190214 B April 25, 2019, 1:40 p.m. OK MS C++ 2017 TESTS 49 46 0 1200
57343621 siwei B July 19, 2019, 8:37 p.m. OK MS C++ 2017 TESTS 49 46 0 1200
59624987 V4V B Aug. 28, 2019, 3:34 p.m. OK MS C++ 2017 TESTS 49 46 0 1200
50612018 Stivion B Feb. 28, 2019, 5:21 p.m. OK MS C++ 2017 TESTS 49 202 0 1200
63323464 shio B Oct. 24, 2019, 4 p.m. OK MS C++ 2017 TESTS 49 1653 307200 1200
43172406 gmusya B Sept. 21, 2018, 9:17 a.m. OK PascalABC.NET TESTS 49 62 409600 1200
43039489 mayakin B Sept. 18, 2018, 2:59 p.m. OK PHP TESTS 49 46 0 1200
43174797 ShyngyS B Sept. 21, 2018, 10:40 a.m. OK PHP TESTS 49 46 409600 1200
42985356 vysotskij.av B Sept. 17, 2018, 9:22 a.m. OK PHP TESTS 49 46 512000 1200
42988729 YESMAths B Sept. 17, 2018, 9:47 a.m. OK PyPy 2 TESTS 49 155 0 1200
57115160 pa.n.ik B July 15, 2019, 7:35 p.m. OK PyPy 2 TESTS 49 156 1228800 1200
43598221 alankrit_singh_1 B Sept. 30, 2018, 8:37 a.m. OK PyPy 2 TESTS 49 171 0 1200
42998697 WENOUT B Sept. 17, 2018, 12:59 p.m. OK PyPy 2 TESTS 49 171 0 1200
43087327 sarthakmanna B Sept. 19, 2018, 4:50 p.m. OK PyPy 2 TESTS 49 171 819200 1200
43480208 soumyasarkar1998 B Sept. 27, 2018, 6:33 a.m. OK PyPy 2 TESTS 49 186 1126400 1200
43396920 kd710306 B Sept. 25, 2018, 6 a.m. OK PyPy 2 TESTS 49 187 1228800 1200
42993518 masonsbro B Sept. 17, 2018, 11:15 a.m. OK PyPy 2 TESTS 49 187 1536000 1200
43104379 Djok216 B Sept. 20, 2018, 7:40 a.m. OK PyPy 2 TESTS 49 187 1843200 1200
43163537 Butane B Sept. 21, 2018, 3:14 a.m. OK PyPy 2 TESTS 49 234 14233600 1200
69039823 ng24_7 B Jan. 18, 2020, 9:50 a.m. OK PyPy 3 TESTS 49 155 0 1200
55110540 vovik123 B June 5, 2019, 5:58 a.m. OK PyPy 3 TESTS 49 156 204800 1200
53212723 morejarphone B April 24, 2019, 6:40 a.m. OK PyPy 3 TESTS 49 170 1331200 1200
58662627 Leendertz B Aug. 12, 2019, 11:30 a.m. OK PyPy 3 TESTS 49 170 1433600 1200
59240664 roman_kruger B Aug. 21, 2019, 7:32 p.m. OK PyPy 3 TESTS 49 170 3072000 1200
50534755 ygape1s B Feb. 26, 2019, 3:10 p.m. OK PyPy 3 TESTS 49 171 204800 1200
49734008 abdolsamad B Feb. 10, 2019, 5:14 p.m. OK PyPy 3 TESTS 49 171 204800 1200
44097532 111vad111 B Oct. 11, 2018, 2:42 a.m. OK PyPy 3 TESTS 49 171 512000 1200
65026346 algdgn B Nov. 15, 2019, 7:52 a.m. OK PyPy 3 TESTS 49 171 1433600 1200
62873972 shall_not_pass B Oct. 18, 2019, 2:41 p.m. OK PyPy 3 TESTS 49 171 1433600 1200
50727251 charan9948 B March 3, 2019, 10:15 a.m. OK Python 2 TESTS 49 171 0 1200
48368833 wolffd B Jan. 14, 2019, 2 a.m. OK Python 2 TESTS 49 171 0 1200
46014964 EoinDavey B Nov. 21, 2018, 1:53 a.m. OK Python 2 TESTS 49 171 0 1200
44453952 mukeremali B Oct. 17, 2018, 5:05 p.m. OK Python 2 TESTS 49 171 0 1200
43654459 aman_shahi2 B Oct. 1, 2018, 5:14 p.m. OK Python 2 TESTS 49 171 0 1200
43160662 vjudge3 B Sept. 21, 2018, 12:42 a.m. OK Python 2 TESTS 49 171 0 1200
43089913 Uchiha_Blood B Sept. 19, 2018, 6:17 p.m. OK Python 2 TESTS 49 171 0 1200
43016104 WNG B Sept. 17, 2018, 11:06 p.m. OK Python 2 TESTS 49 171 0 1200
43006843 wangkan2001 B Sept. 17, 2018, 4:22 p.m. OK Python 2 TESTS 49 171 102400 1200
46454093 Mulx10 B Dec. 1, 2018, 5:19 p.m. OK Python 2 TESTS 49 171 716800 1200
55969212 Akriel B June 23, 2019, 1:48 p.m. OK Python 3 TESTS 49 108 0 1200
51152845 AIshutin B March 11, 2019, 8:57 a.m. OK Python 3 TESTS 49 109 0 1200
45415397 Vasiliy_48 B Nov. 7, 2018, 1:57 p.m. OK Python 3 TESTS 49 109 0 1200
43001569 Flavio_Correia B Sept. 17, 2018, 2:03 p.m. OK Python 3 TESTS 49 109 0 1200
44700564 JaeGer B Oct. 22, 2018, 2:39 p.m. OK Python 3 TESTS 49 109 102400 1200
63712098 aliakbar09a B Oct. 29, 2019, 10:24 a.m. OK Python 3 TESTS 49 109 204800 1200
67656651 kirtanpathak4 B Dec. 26, 2019, 2:10 p.m. OK Python 3 TESTS 49 109 307200 1200
62329817 arnav_jain1006 B Oct. 10, 2019, 8:07 p.m. OK Python 3 TESTS 49 109 307200 1200
55185441 aman06016 B June 6, 2019, 3:06 a.m. OK Python 3 TESTS 49 109 307200 1200
50591808 pixc B Feb. 28, 2019, 7:53 a.m. OK Python 3 TESTS 49 109 307200 1200
43091312 clupasq B Sept. 19, 2018, 7:05 p.m. OK Ruby TESTS 49 77 102400 1200
43053551 clrcldy B Sept. 19, 2018, 1:03 a.m. OK Rust TESTS 49 31 102400 1200

remove filters

Back to search problems