VK Cup 2017 - Wild Card Round 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
774 VK Cup 2017 - Wild Card Round 1 FINISHED False 7200 284999123 April 5, 2017, 3:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 155 ) I Composing Of String PROGRAMMING *special dp 2500

Stepan has a set of n strings. Also, he has a favorite string s . Stepan wants to do the following. He will take some strings of his set and write them down one after another. It is possible that he will take some strings more than once, and will not take some of them at all. Your task is to determine the minimum number of strings in the set which Stepan needs to take and write so that the string s appears as a subsequence in the resulting written down string. For example, in the string " abcd " strings " ad ", " acd ", " abcd " appear as subsequences, and strings " ba ", " abdc " don't appear as subsequences. The first line contains the integer n ( 1 ≤ n ≤ 50 ) — the number of strings in Stepan's set. The next n lines contain n non-empty strings consisting of lowercase letters of the English alphabet. The length of each of these strings does not exceed 50 symbols. It is possible that some strings from Stepan's set are the same. The next line contains the non-empty string s , consisting of lowercase letters of the English alphabet — Stepan's favorite string. The length of this string doesn't exceed 2500 symbols. Print the minimum number of strings which Stepan should take from the set and write them down one after another so that the string s appears as a subsequence in the resulting written down string. Each string from the set should be counted as many times as Stepan takes it from the set. If the answer doesn't exsist, print -1 . In the first test, Stepan can take, for example, the third and the second strings from the set, write them down, and get exactly his favorite string. In the second example Stepan can take, for example, the second, the third and again the second strings from the set and write them down. Then he will get a string " aabaaaab ", in which his favorite string " baaab " is a subsequence. In the third test Stepan can not get his favorite string, because it contains the letter " c ", which is not presented in any of the strings in the s

Tutorials

VK Cup 2017 — Уайлд-кард раунд 1 — Разбор

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
34444904 Worldwide_D I Jan. 22, 2018, 11:32 a.m. OK GNU C++ TESTS 46 31 1945600 2500
26655737 Unsterblicher_Geist I April 25, 2017, 8:41 a.m. OK GNU C++ TESTS 46 46 38707200 2500
26196848 abczyxb I April 7, 2017, 3:04 p.m. OK GNU C11 TESTS 46 31 1945600 2500
36330046 AdvancerMan I March 16, 2018, 3:29 p.m. OK GNU C11 TESTS 46 31 3276800 2500
26599768 robodobo I April 23, 2017, 9:10 a.m. OK GNU C++11 TESTS 46 31 2252800 2500
47715545 Mlxa I Dec. 30, 2018, 7:24 a.m. OK GNU C++14 TESTS 46 31 204800 2500
47715506 Mlxa I Dec. 30, 2018, 7:22 a.m. OK GNU C++14 TESTS 46 31 204800 2500
26231707 _ShadowSong I April 9, 2017, 7:20 a.m. OK GNU C++14 TESTS 46 31 1945600 2500
26150030 Eran Javanochka I April 5, 2017, 4:21 p.m. OK GNU C++14 TESTS 46 31 2048000 2500
50619699 mdj982 I Feb. 28, 2019, 11:13 p.m. OK GNU C++14 TESTS 46 46 204800 2500
48518902 CodigoL I Jan. 18, 2019, 5:52 a.m. OK GNU C++14 TESTS 46 46 204800 2500
57576944 Jubair_2147483647 I July 23, 2019, 7:24 a.m. OK GNU C++14 TESTS 46 78 26112000 2500
26151717 kodek bitcom I April 5, 2017, 4:42 p.m. OK GNU C++14 TESTS 46 514 2048000 2500
40982837 ReaLNero1 I July 30, 2018, 6:36 p.m. OK Go TESTS 46 62 204800 2500
26155179 nickpros DmitryGrigorev I April 5, 2017, 5:31 p.m. OK Java 8 TESTS 46 155 20377600 2500
26200795 aleex I April 7, 2017, 5:56 p.m. OK Java 8 TESTS 46 155 20889600 2500
26155119 VernitaGreen svxf I April 5, 2017, 5:30 p.m. OK Java 8 TESTS 46 156 20582400 2500
26154546 gars Provet I April 5, 2017, 5:23 p.m. OK JavaScript TESTS 46 46 6144000 2500
26360886 krijgertje I April 14, 2017, 3:31 p.m. OK Mono C# TESTS 46 62 9113600 2500
26153981 Albert1401 antkhorin I April 5, 2017, 5:14 p.m. OK Mono C# TESTS 46 62 11673600 2500
26503978 Noam527 I April 19, 2017, 8:36 p.m. OK MS C# TESTS 46 61 9011200 2500
35774488 nevgen I Feb. 27, 2018, 8:27 p.m. OK MS C# TESTS 46 61 9318400 2500
26453750 6eJIa9IzZzTeHb I April 17, 2017, 11:58 a.m. OK PHP TESTS 46 702 6041600 2500

remove filters

Back to search problems