Codeforces Round 402 (Div. 1)

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
778 Codeforces Round 402 (Div. 1) FINISHED False 7200 249429323 Feb. 26, 2017, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 337 ) E Selling Numbers PROGRAMMING dp sortings 2900

B"Boris really likes numbers and even owns a small shop selling interesting numbers. He has n decimal numbers Bi. Cost of the number in his shop is equal to the sum of costs of its digits. You are given the values cd, where cd is the cost of the digit d. Of course, Boris is interested in that numbers he owns have the maximum cost possible. Recently Boris got hold of the magical artifact A, which can allow him to increase the cost of his collection. Artifact is a string, consisting of digits and '?' symbols. To use the artifact, Boris must replace all '?' with digits to get a decimal number without leading zeros (it is also not allowed to get number 0). After that, the resulting number is added to all numbers Bi in Boris' collection. He uses the artifact exactly once. What is the maximum cost of the collection Boris can achieve after using the artifact? First line contains artifact A, consisting of digits '0' xe2 x80 x93'9' and '?' symbols (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|A| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000). Next line contains n -- the amount of numbers in Boris' collection (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000). Next n lines contain integers Bi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89Bi xe2 x80 x89< xe2 x80 x89101000). A doesn't start with '0'. Last line contains ten integers -- costs of digits c0, xe2 x80 x89c1, xe2 x80 x89..., xe2 x80 x89c9 (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ci xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000). Output one integer -- the maximum possible cost of the collection after using the artifact. In the second sample input, the optimal way is to compose the number 453. After adding this number, Boris will have numbers 2656, 5682, 729 and 6696. The total cost of all digits in them is equal to 18 xe2 x80 x89+ xe2 x80 x8915 xe2 x80 x89+ xe2 x80 x8911 xe2 x80 x89+ xe2 x80 x8918 xe2 x80 x89= xe2 x80 x8962. "...

Tutorials

Codeforces Round #402, Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
25052225 htnhtn E Feb. 26, 2017, 11:44 a.m. OK GNU C++ TESTS 71 93 7065600 2900
27450491 kut_ksr1994 E May 30, 2017, 2:50 p.m. OK GNU C++ TESTS 71 139 20172800 2900
25045475 LoneFox E Feb. 26, 2017, 9:34 a.m. OK GNU C++ TESTS 71 140 11161600 2900
31707705 lyx_cjz E Oct. 25, 2017, 11:54 a.m. OK GNU C++ TESTS 71 156 1433600 2900
27415370 jiyutian E May 28, 2017, 3:01 p.m. OK GNU C++ TESTS 71 156 9011200 2900
25056394 Chloe_fan E Feb. 26, 2017, 1:49 p.m. OK GNU C++ TESTS 71 156 10240000 2900
25569519 alexma E March 17, 2017, 10:53 a.m. OK GNU C++ TESTS 71 156 11161600 2900
26656449 mjmilan11 E April 25, 2017, 9:09 a.m. OK GNU C++ TESTS 71 156 13107200 2900
25167737 mlz000 E March 3, 2017, 11:05 a.m. OK GNU C++ TESTS 71 156 15257600 2900
25296030 XuYipei E March 6, 2017, 3:16 p.m. OK GNU C++ TESTS 71 156 156467200 2900
25091570 molamola. E Feb. 28, 2017, 2:42 a.m. OK GNU C++11 TESTS 71 77 7168000 2900
40982140 ReaLNero1 E July 30, 2018, 6:17 p.m. OK GNU C++11 TESTS 71 93 4915200 2900
44830348 emoairx E Oct. 25, 2018, 8:10 a.m. OK GNU C++11 TESTS 71 93 5120000 2900
25070567 htnhtn E Feb. 27, 2017, 6:53 a.m. OK GNU C++11 TESTS 71 93 7065600 2900
25048918 gs12117 E Feb. 26, 2017, 10:41 a.m. OK GNU C++11 TESTS 71 93 7065600 2900
25066675 BSBandme E Feb. 27, 2017, 12:11 a.m. OK GNU C++11 TESTS 71 108 3174400 2900
25066667 BSBandme E Feb. 27, 2017, 12:10 a.m. OK GNU C++11 TESTS 71 108 3174400 2900
56666416 207M E July 7, 2019, 11:20 a.m. OK GNU C++11 TESTS 71 109 5120000 2900
27465136 kolyukkonen E May 31, 2017, 11:18 a.m. OK GNU C++11 TESTS 71 109 5222400 2900
34736064 zhouyuyang E Jan. 31, 2018, 11:57 a.m. OK GNU C++11 TESTS 71 109 7168000 2900
44723090 Lynstery E Oct. 23, 2018, 6:32 a.m. OK GNU C++14 TESTS 71 78 8089600 2900
39883482 consecutivelimit E July 3, 2018, 4:38 a.m. OK GNU C++14 TESTS 71 93 5120000 2900
25070568 htnhtn E Feb. 27, 2017, 6:53 a.m. OK GNU C++14 TESTS 71 108 7065600 2900
25143978 lys1280023 E March 2, 2017, 9:43 a.m. OK GNU C++14 TESTS 71 109 6963200 2900
25070909 zgncycz E Feb. 27, 2017, 7:21 a.m. OK GNU C++14 TESTS 71 124 3072000 2900
25228868 Worg E March 4, 2017, 10:43 p.m. OK GNU C++14 TESTS 71 124 11161600 2900
35065143 OTTEBROT E Feb. 8, 2018, 4:08 p.m. OK GNU C++14 TESTS 71 124 16076800 2900
35772615 spetsnaz E Feb. 27, 2018, 6:55 p.m. OK GNU C++14 TESTS 71 139 3993600 2900
25303289 -XraY- E March 6, 2017, 9:08 p.m. OK GNU C++14 TESTS 71 140 3174400 2900
25095357 shdut E Feb. 28, 2017, 8:03 a.m. OK GNU C++14 TESTS 71 140 6553600 2900
48716418 CMXRYNP E Jan. 22, 2019, 11:30 a.m. OK GNU C++17 TESTS 71 93 5017600 2900
46395260 hyfzbtrs E Nov. 30, 2018, 8:49 a.m. OK GNU C++17 TESTS 71 140 9216000 2900
46395190 hyfzbtrs E Nov. 30, 2018, 8:46 a.m. OK GNU C++17 TESTS 71 140 9216000 2900
51306391 Smaug E March 14, 2019, 5 p.m. OK GNU C++17 TESTS 71 156 6144000 2900
51306426 vjudge4 E March 14, 2019, 5:01 p.m. OK GNU C++17 TESTS 71 171 6144000 2900
54430451 ArshiaDadras E May 20, 2019, 10:22 p.m. OK GNU C++17 TESTS 71 171 8294400 2900
49672753 AliHeidary1381 E Feb. 9, 2019, 5:53 p.m. OK GNU C++17 TESTS 71 171 13721600 2900
49672617 Noche_2 E Feb. 9, 2019, 5:48 p.m. OK GNU C++17 TESTS 71 171 13721600 2900
67068141 AM. E Dec. 17, 2019, 11:50 a.m. OK GNU C++17 TESTS 71 217 10035200 2900
65270465 Hikori E Nov. 17, 2019, 7:28 p.m. OK GNU C++17 TESTS 71 218 16179200 2900
25815146 zefcod E March 26, 2017, 9:19 a.m. OK Java 8 TESTS 71 857 22835200 2900
25267059 Tifuera E March 5, 2017, 4:02 p.m. OK Java 8 TESTS 71 1481 21094400 2900
25452706 lucyanna2018 E March 13, 2017, 11:44 a.m. OK MS C++ TESTS 71 265 8396800 2900
25055744 DEGwer E Feb. 26, 2017, 1:25 p.m. OK MS C++ TESTS 71 592 60723200 2900

remove filters

Back to search problems