Codeforces Round 558 (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
1163 Codeforces Round 558 (Div. 2) FINISHED False 7200 174408899 May 9, 2019, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1286 ) D Mysterious Code PROGRAMMING dp strings 2200

B'During a normal walk in the forest, Katie has stumbled upon a mysterious code! However, the mysterious code had some characters unreadable. She has written down this code as a string c consisting of lowercase English characters and asterisks ("*"), where each of the asterisks denotes an unreadable character. Excited with her discovery, Katie has decided to recover the unreadable characters by replacing each asterisk with arbitrary lowercase English letter (different asterisks might be replaced with different letters). Katie has a favorite string s and a not-so-favorite string t and she would love to recover the mysterious code so that it has as many occurrences of s as possible and as little occurrences of t as possible. Formally, let 's denote f(x, y) as the number of occurrences of y in x (for example, f(aababa, ab) = 2 ). Katie wants to recover the code c ' conforming to the original c , such that f(c ', s) - f(c ', t) is largest possible. However, Katie is not very good at recovering codes in general, so she would like you to help her out. The first line contains string c ( 1 <= q |c| <= q 1000 ) -- the mysterious code . It is guaranteed that c consists of lowercase English characters and asterisks "*" only. The second and third line contain strings s and t respectively ( 1 <= q |s|, |t| <= q 50 , s neq t ). It is guaranteed that s and t consist of lowercase English characters only. Print a single integer -- the largest possible value of f(c ', s) - f(c ', t) of the recovered code. In the first example, for c ' equal to "katie" f(c ', s) = 1 and f(c ', t) = 0 , which makes f(c ', s) - f(c ', t) = 1 which is the largest possible. In the second example, the only c ' conforming to the given c is "caat". The corresponding f(c ', s) - f(c ', t) = 1 - 2 = -1 . In the third example, there are multiple ways'...

Tutorials

66943

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
55540445 rainboy D June 13, 2019, 7:19 p.m. OK GNU C11 TESTS 72 46 0 2200
54514794 SoiMae D May 23, 2019, 9:12 a.m. OK GNU C++11 TESTS 72 31 0 2200
54004221 danya090699 D May 11, 2019, 6:34 p.m. OK GNU C++11 TESTS 72 31 0 2200
55601473 caa_tomsk D June 15, 2019, 6:40 p.m. OK GNU C++11 TESTS 72 31 0 2200
57860018 KMAASZRAA D July 27, 2019, 5:13 p.m. OK GNU C++11 TESTS 72 31 0 2200
54011334 FelixMirave D May 12, 2019, 2:39 a.m. OK GNU C++11 TESTS 72 31 102400 2200
53981778 SYSS_S D May 11, 2019, 7:30 a.m. OK GNU C++11 TESTS 72 31 102400 2200
53948834 365050244 D May 10, 2019, 8:22 a.m. OK GNU C++11 TESTS 72 31 102400 2200
54087928 Stupid_cdd D May 14, 2019, 8:39 a.m. OK GNU C++11 TESTS 72 31 102400 2200
53944139 dqa2020 D May 10, 2019, 5:28 a.m. OK GNU C++11 TESTS 72 31 307200 2200
53956962 xht37 D May 10, 2019, 12:19 p.m. OK GNU C++11 TESTS 72 31 307200 2200
54046553 Gxp233 D May 12, 2019, 4:58 p.m. OK GNU C++14 TESTS 72 30 1638400 2200
54834267 SushiNinja D May 30, 2019, 10:14 a.m. OK GNU C++14 TESTS 72 30 37478400 2200
53923130 Just_a_fat D May 9, 2019, 4:18 p.m. OK GNU C++14 TESTS 72 31 102400 2200
59847525 schtomi97 D Sept. 1, 2019, 10:07 a.m. OK GNU C++14 TESTS 72 31 409600 2200
53913955 lumingqi D May 9, 2019, 3:25 p.m. OK GNU C++14 TESTS 72 31 512000 2200
54081365 ambitionly D May 14, 2019, 3:29 a.m. OK GNU C++14 TESTS 72 31 819200 2200
53925947 _no0B D May 9, 2019, 4:37 p.m. OK GNU C++14 TESTS 72 31 1126400 2200
53972796 sumerKing D May 11, 2019, 12:48 a.m. OK GNU C++14 TESTS 72 31 4198400 2200
54159818 Newusers D May 15, 2019, 6 a.m. OK GNU C++14 TESTS 72 31 5017600 2200
61589105 F-Mu D Oct. 1, 2019, 6:18 a.m. OK GNU C++14 TESTS 72 31 8294400 2200
53927135 orz_liuwei D May 9, 2019, 4:45 p.m. OK GNU C++17 TESTS 72 31 0 2200
53933709 m1sch3f D May 9, 2019, 8:02 p.m. OK GNU C++17 TESTS 72 31 0 2200
53928273 Shayan.P D May 9, 2019, 4:52 p.m. OK GNU C++17 TESTS 72 31 0 2200
53974738 libra9z D May 11, 2019, 2:53 a.m. OK GNU C++17 TESTS 72 31 0 2200
57982158 libra9z D July 30, 2019, 9:49 a.m. OK GNU C++17 TESTS 72 31 0 2200
53915736 bbao69 D May 9, 2019, 3:34 p.m. OK GNU C++17 TESTS 72 31 204800 2200
53931031 saketh D May 9, 2019, 5:49 p.m. OK GNU C++17 TESTS 72 31 204800 2200
60247404 S.K D Sept. 8, 2019, 4:03 a.m. OK GNU C++17 TESTS 72 31 409600 2200
53958091 KillerX D May 10, 2019, 12:48 p.m. OK GNU C++17 TESTS 72 31 409600 2200
53958074 vjudge2 D May 10, 2019, 12:48 p.m. OK GNU C++17 TESTS 72 31 409600 2200
53928698 barakraganosungam D May 9, 2019, 4:55 p.m. OK Java 8 TESTS 72 124 4710400 2200
53994071 karamkontar D May 11, 2019, 1:39 p.m. OK Java 8 TESTS 72 124 4812800 2200
59375481 beginner1010 D Aug. 23, 2019, 9:30 p.m. OK Java 8 TESTS 72 139 4710400 2200
63264015 gouh9qn D Oct. 23, 2019, 10:14 p.m. OK Java 8 TESTS 72 140 0 2200
53932303 Taran_1407 D May 9, 2019, 6:50 p.m. OK Java 8 TESTS 72 140 4505600 2200
53921260 4mda4mda D May 9, 2019, 4:06 p.m. OK Java 8 TESTS 72 140 5120000 2200
53927617 Musin D May 9, 2019, 4:48 p.m. OK Java 8 TESTS 72 155 4198400 2200
54002051 aminul D May 11, 2019, 5:01 p.m. OK Java 8 TESTS 72 155 5120000 2200
53926309 Harpae D May 9, 2019, 4:39 p.m. OK Java 8 TESTS 72 155 16691200 2200
54002229 aminul D May 11, 2019, 5:09 p.m. OK Java 8 TESTS 72 156 5120000 2200
54415286 TrabajoNocturno D May 20, 2019, 12:13 p.m. OK Mono C# TESTS 72 62 77824000 2200
53917916 mircea85 D May 9, 2019, 3:46 p.m. OK Mono C# TESTS 72 264 102400 2200
54442208 gaozqxin D May 21, 2019, 9:17 a.m. OK Mono C# TESTS 72 1840 6963200 2200
53987605 tang0404 D May 11, 2019, 10:36 a.m. OK MS C++ TESTS 72 31 16588800 2200
54262110 2017111799yjl D May 17, 2019, 2:51 a.m. OK MS C++ 2017 TESTS 72 46 12185600 2200
53967107 CtrlAlt D May 10, 2019, 5:50 p.m. OK MS C++ 2017 TESTS 72 46 14540800 2200
55239035 Atlasmoth D June 7, 2019, 9:53 a.m. OK MS C++ 2017 TESTS 72 62 3174400 2200
53924050 ialakhtin D May 9, 2019, 4:24 p.m. OK MS C++ 2017 TESTS 72 295 512000 2200
54004362 c1729 D May 11, 2019, 6:39 p.m. OK PyPy 2 TESTS 72 217 13004800 2200
54004455 c1729 D May 11, 2019, 6:43 p.m. OK PyPy 2 TESTS 72 218 13107200 2200
54005183 c1729 D May 11, 2019, 7:20 p.m. OK PyPy 2 TESTS 72 233 13721600 2200
60594496 pajenegod D Sept. 15, 2019, 4:37 a.m. OK PyPy 2 TESTS 72 1013 16384000 2200
53949020 yakamoto D May 10, 2019, 8:28 a.m. OK Scala TESTS 72 1933 12697600 2200

remove filters

Back to search problems