Codeforces Round 811 (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
1714 Codeforces Round 811 (Div. 3) FINISHED False 8100 77815463 Aug. 1, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9322 ) D Color with Occurrences PROGRAMMING dp greedy strings

B'You are given some text t and a set of n strings s_1, s_2, ... , s_n . In one step, you can choose any occurrence of any string s_i in the text t and color the corresponding characters of the text in red. For example, if t= texttt{bababa} and s_1= texttt{ba} , s_2= texttt{aba} , you can get t= color{red}{ texttt{ba}} texttt{baba} , t= texttt{b} color{red}{ texttt{aba}} texttt{ba} or t= texttt{bab} color{red}{ texttt{aba}} in one step. You want to color all the letters of the text t in red. When you color a letter in red again, it stays red. In the example above, three steps are enough: Each string s_i can be applied any number of times (or not at all). Occurrences for coloring can intersect arbitrarily. Determine the minimum number of steps needed to color all letters t in red and how to do it. If it is impossible to color all letters of the text t in red, output -1. The first line of the input contains an integer q ( 1 <= q <= 100 ) --the number of test cases in the test. The descriptions of the test cases follow. The first line of each test case contains the text t ( 1 <= |t| <= 100 ), consisting only of lowercase Latin letters, where |t| is the length of the text t . The second line of each test case contains a single integer n ( 1 <= n <= 10 ) -- the number of strings in the set. This is followed by n lines, each containing a string s_i ( 1 <= |s_i| <= 10 ) consisting only of lowercase Latin letters, where |s_i| -- the length of string s_i . For each test case, print the answer on a separate line. If it is impossible to color all the letters of the text in red, print a single line containing the number -1. Otherwise, on the first line, print the number m -- the minimum number of steps it will take to turn all the letters t red. Then in the next m lines print pairs of '...

Tutorials

Codeforces Round #811 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
166604029 kakooda D Aug. 1, 2022, 5:11 p.m. OK FPC TESTS 5 30 1843200
166634710 NenadDapic D Aug. 2, 2022, 12:44 a.m. OK FPC TESTS 19 46 0
166654158 louwuchen D Aug. 2, 2022, 5:54 a.m. OK GNU C++14 TESTS 19 15 0
166650120 peterpi23 D Aug. 2, 2022, 4:58 a.m. OK GNU C++14 TESTS 19 15 0
166644206 cqbztl D Aug. 2, 2022, 3:21 a.m. OK GNU C++14 TESTS 19 15 0
166642289 Pluto_Xz D Aug. 2, 2022, 2:52 a.m. OK GNU C++14 TESTS 19 15 0
166637203 THHZ D Aug. 2, 2022, 1:33 a.m. OK GNU C++14 TESTS 19 15 0
166637169 Qg5 D Aug. 2, 2022, 1:33 a.m. OK GNU C++14 TESTS 19 15 0
166636235 1248906012 D Aug. 2, 2022, 1:16 a.m. OK GNU C++14 TESTS 19 15 0
166609430 Varni D Aug. 1, 2022, 5:50 p.m. OK GNU C++14 TESTS 7 15 0
166608731 u1904123 D Aug. 1, 2022, 5:45 p.m. OK GNU C++14 TESTS 7 15 0
166605437 canon_ D Aug. 1, 2022, 5:20 p.m. OK GNU C++14 TESTS 7 15 0
166603274 iwillking D Aug. 1, 2022, 5:07 p.m. OK GNU C++17 TESTS 5 0 0
166598786 errormakers D Aug. 1, 2022, 4:49 p.m. OK GNU C++17 TESTS 5 0 0
166601447 ezdp D Aug. 1, 2022, 4:58 p.m. OK GNU C++17 TESTS 5 0 102400
166653785 helloworld_cout D Aug. 2, 2022, 5:50 a.m. OK GNU C++17 TESTS 19 15 0
166653755 KDVinit D Aug. 2, 2022, 5:49 a.m. OK GNU C++17 TESTS 19 15 0
166651326 abhi_8923 D Aug. 2, 2022, 5:14 a.m. OK GNU C++17 TESTS 19 15 0
166651058 James_Lee D Aug. 2, 2022, 5:11 a.m. OK GNU C++17 TESTS 19 15 0
166648420 Huagass D Aug. 2, 2022, 4:31 a.m. OK GNU C++17 TESTS 19 15 0
166647067 Svapnil007 D Aug. 2, 2022, 4:08 a.m. OK GNU C++17 TESTS 19 15 0
166646932 chotpisit080916c D Aug. 2, 2022, 4:06 a.m. OK GNU C++17 TESTS 19 15 0
166609827 OnMyZenith D Aug. 1, 2022, 5:54 p.m. OK GNU C++17 (64) TESTS 7 0 0
166607673 Apelpul D Aug. 1, 2022, 5:36 p.m. OK GNU C++17 (64) TESTS 7 0 0
166604587 CigarettesAfterSex D Aug. 1, 2022, 5:14 p.m. OK GNU C++17 (64) TESTS 7 0 0
166602817 vlad_1028 D Aug. 1, 2022, 5:04 p.m. OK GNU C++17 (64) TESTS 5 0 0
166602261 XHYU61 D Aug. 1, 2022, 5:02 p.m. OK GNU C++17 (64) TESTS 5 0 0
166600936 cbmano D Aug. 1, 2022, 4:56 p.m. OK GNU C++17 (64) TESTS 5 0 0
166599537 BalaluevEgor D Aug. 1, 2022, 4:51 p.m. OK GNU C++17 (64) TESTS 5 0 0
166619704 Hackapie D Aug. 1, 2022, 7:35 p.m. OK GNU C++17 (64) TESTS 7 0 102400
166617151 Beevo D Aug. 1, 2022, 7:05 p.m. OK GNU C++17 (64) TESTS 7 0 102400
166604105 CedeaT0 D Aug. 1, 2022, 5:11 p.m. OK GNU C++17 (64) TESTS 5 0 1638400
166650336 Ormlis D Aug. 2, 2022, 5:01 a.m. OK GNU C++20 (64) TESTS 19 0 0
166647453 xiaolaji007 D Aug. 2, 2022, 4:15 a.m. OK GNU C++20 (64) TESTS 19 0 0
166640483 Yaqu D Aug. 2, 2022, 2:24 a.m. OK GNU C++20 (64) TESTS 19 0 0
166619684 wjli D Aug. 1, 2022, 7:35 p.m. OK GNU C++20 (64) TESTS 7 0 0
166617200 TheLazyBoy D Aug. 1, 2022, 7:06 p.m. OK GNU C++20 (64) TESTS 7 0 0
166616521 rgnerdplayer D Aug. 1, 2022, 6:58 p.m. OK GNU C++20 (64) TESTS 7 0 0
166615273 tolbi D Aug. 1, 2022, 6:44 p.m. OK GNU C++20 (64) TESTS 7 0 0
166614223 xwdmw D Aug. 1, 2022, 6:33 p.m. OK GNU C++20 (64) TESTS 7 0 0
166609884 Srayan D Aug. 1, 2022, 5:54 p.m. OK GNU C++20 (64) TESTS 7 0 0
166609452 Thallium54 D Aug. 1, 2022, 5:51 p.m. OK GNU C++20 (64) TESTS 7 0 0
166600098 O_Vladimir D Aug. 1, 2022, 4:52 p.m. OK Go TESTS 5 78 5017600
166609113 san1201 D Aug. 1, 2022, 5:48 p.m. OK Go TESTS 7 109 2662400
166653211 justOneStep D Aug. 2, 2022, 5:41 a.m. OK Go TESTS 19 654 614400
166607215 akshat_iiitb D Aug. 1, 2022, 5:32 p.m. OK Java 11 TESTS 7 186 0
166636081 profchi D Aug. 2, 2022, 1:13 a.m. OK Java 11 TESTS 19 202 0
166639776 aditya2024 D Aug. 2, 2022, 2:13 a.m. OK Java 11 TESTS 19 218 0
166604912 QPALZM123 D Aug. 1, 2022, 5:16 p.m. OK Java 11 TESTS 7 218 0
166604814 himanshu19468 D Aug. 1, 2022, 5:15 p.m. OK Java 11 TESTS 7 233 0
166623921 atishay_5203 D Aug. 1, 2022, 8:31 p.m. OK Java 11 TESTS 19 265 204800
166598462 Ani_S D Aug. 1, 2022, 4:48 p.m. OK Java 11 TESTS 5 327 0
166640013 kkz666 D Aug. 2, 2022, 2:17 a.m. OK Java 17 TESTS 19 218 614400
166617132 soumit915 D Aug. 1, 2022, 7:05 p.m. OK Java 17 TESTS 7 233 614400
166620849 eggag32 D Aug. 1, 2022, 7:48 p.m. OK Java 17 TESTS 19 264 716800
166639396 RetARDed1111 D Aug. 2, 2022, 2:07 a.m. OK Java 8 TESTS 19 93 0
166621987 Mohamed308 D Aug. 1, 2022, 8:04 p.m. OK Java 8 TESTS 19 108 0
166614382 leonlian D Aug. 1, 2022, 6:35 p.m. OK Java 8 TESTS 7 124 0
166601391 HideBeyondYou D Aug. 1, 2022, 4:57 p.m. OK Java 8 TESTS 5 139 0
166603863 ggghg D Aug. 1, 2022, 5:10 p.m. OK Java 8 TESTS 5 140 0
166603552 iykyk D Aug. 1, 2022, 5:08 p.m. OK Java 8 TESTS 5 186 0
166602943 Islam12123 D Aug. 1, 2022, 5:05 p.m. OK Java 8 TESTS 5 202 0
166621628 subhankar.majumdar.752 D Aug. 1, 2022, 7:59 p.m. OK Java 8 TESTS 19 264 0
166640848 Zahid_Hasan_Sahin D Aug. 2, 2022, 2:29 a.m. OK Java 8 TESTS 19 1778 0
166634762 ripity D Aug. 2, 2022, 12:46 a.m. OK Kotlin 1.6 TESTS 19 233 0
166598746 NanQin D Aug. 1, 2022, 4:49 p.m. OK MS C++ 2017 TESTS 5 15 0
166619265 KKastaneda D Aug. 1, 2022, 7:30 p.m. OK MS C++ 2017 TESTS 7 62 0
166631897 SIGCHLD D Aug. 1, 2022, 11:28 p.m. OK PyPy 3 TESTS 19 155 5324800
166644819 LarryNY D Aug. 2, 2022, 3:31 a.m. OK PyPy 3 TESTS 19 186 3891200
166625966 hxu10 D Aug. 1, 2022, 9:06 p.m. OK PyPy 3 TESTS 19 202 7782400
166603536 Aksnov D Aug. 1, 2022, 5:08 p.m. OK PyPy 3-64 TESTS 5 109 8806400
166601133 bjy D Aug. 1, 2022, 4:56 p.m. OK PyPy 3-64 TESTS 5 124 6860800
166602409 ulyabelyaeva D Aug. 1, 2022, 5:02 p.m. OK PyPy 3-64 TESTS 5 124 7372800
166610228 lullabies777 D Aug. 1, 2022, 5:57 p.m. OK PyPy 3-64 TESTS 7 124 8908800
166622722 SoleProprietor D Aug. 1, 2022, 8:15 p.m. OK PyPy 3-64 TESTS 19 124 9216000
166610801 lullabies777 D Aug. 1, 2022, 6:02 p.m. OK PyPy 3-64 TESTS 7 124 9625600
166630082 hes4rn D Aug. 1, 2022, 10:38 p.m. OK PyPy 3-64 TESTS 19 140 9420800
166603290 fireSlayer57 D Aug. 1, 2022, 5:07 p.m. OK PyPy 3-64 TESTS 5 155 9216000
166646314 Turtleeee D Aug. 2, 2022, 3:55 a.m. OK PyPy 3-64 TESTS 19 155 9420800
166629823 unknownSolver D Aug. 1, 2022, 10:31 p.m. OK PyPy 3-64 TESTS 19 155 9523200
166653709 n5rut0 D Aug. 2, 2022, 5:49 a.m. OK Python 3 TESTS 19 109 409600
166607019 fastem D Aug. 1, 2022, 5:31 p.m. OK Python 3 TESTS 7 124 0
166605494 jackson.souza D Aug. 1, 2022, 5:20 p.m. OK Python 3 TESTS 7 124 0
166637220 eugalt D Aug. 2, 2022, 1:34 a.m. OK Python 3 TESTS 19 139 0
166643537 eugalt D Aug. 2, 2022, 3:11 a.m. OK Python 3 TESTS 19 140 0
166643126 eugalt D Aug. 2, 2022, 3:05 a.m. OK Python 3 TESTS 19 140 0
166635087 odinluca D Aug. 2, 2022, 12:53 a.m. OK Python 3 TESTS 19 436 0
166600495 kobae964 D Aug. 1, 2022, 4:54 p.m. OK Rust 2021 TESTS 5 15 204800
166621891 luukaos D Aug. 1, 2022, 8:03 p.m. OK Rust 2021 TESTS 19 62 614400

remove filters

Back to search problems