Codeforces Round 570 (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
1183 Codeforces Round 570 (Div. 3) FINISHED False 8100 170263499 June 26, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3200 ) H Subsequences (hard version) PROGRAMMING dp strings 2200

B'The only difference between the easy and the hard versions is constraints. A subsequence is a string that can be derived from another string by deleting some or no symbols without changing the order of the remaining symbols. Characters to be deleted are not required to go successively, there can be any gaps between them. For example, for the string "abaca" the following strings are subsequences: "abaca", "aba", "aaa", "a" and "" (empty string). But the following strings are not subsequences: "aabaca", "cb" and "bcaa". You are given a string s consisting of n lowercase Latin letters. In one move you can take any subsequence t of the given string and add it to the set S . The set S can 't contain duplicates. This move costs n - |t| , where |t| is the length of the added subsequence (i.e. the price equals to the number of the deleted characters). Your task is to find out the minimum possible total cost to obtain a set S of size k or report that it is impossible to do so. The first line of the input contains two integers n and k ( 1 <= n <= 100, 1 <= k <= 10^{12} ) -- the length of the string and the size of the set, correspondingly. The second line of the input contains a string s consisting of n lowercase Latin letters. Print one integer -- if it is impossible to obtain the set S of size k , print -1. Otherwise, print the minimum possible total cost to do it. In the first example we can generate S = { "asdf", "asd", "adf", "asf", "sdf" }. The cost of the first element in S is 0 and the cost of the others is 1 . So the total cost of S is 4 . '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
58070595 MRoy H July 31, 2019, 10:30 a.m. OK GNU C11 TESTS 70 31 102400 2200
56413482 ninety9 H July 2, 2019, 2:34 a.m. OK GNU C11 TESTS 70 31 102400 2200
56420741 sansen H July 2, 2019, 7:12 a.m. OK GNU C11 TESTS 70 31 102400 2200
59095626 pbihao H Aug. 19, 2019, 2:07 p.m. OK GNU C++11 TESTS 70 31 0 2200
59094840 asdfghjk H Aug. 19, 2019, 1:52 p.m. OK GNU C++11 TESTS 70 31 0 2200
58676934 chfbcho H Aug. 12, 2019, 4:57 p.m. OK GNU C++11 TESTS 70 31 0 2200
58205129 vjudge3 H Aug. 3, 2019, 6:36 a.m. OK GNU C++11 TESTS 70 31 0 2200
59517441 tyakennikku H Aug. 26, 2019, 10:40 a.m. OK GNU C++11 TESTS 70 31 0 2200
64157037 yalizjc H Nov. 3, 2019, 1:09 p.m. OK GNU C++11 TESTS 70 31 0 2200
63761465 Max.D. H Oct. 30, 2019, 4:02 a.m. OK GNU C++11 TESTS 70 31 0 2200
60379906 luogu_bot5 H Sept. 11, 2019, 8:35 a.m. OK GNU C++11 TESTS 70 31 0 2200
59259690 1706915033 H Aug. 22, 2019, 8:04 a.m. OK GNU C++11 TESTS 70 31 0 2200
61174898 code_struck H Sept. 23, 2019, 5:49 p.m. OK GNU C++11 TESTS 70 31 0 2200
58108583 Chamo H Aug. 1, 2019, 5:55 a.m. OK GNU C++14 TESTS 70 15 102400 2200
56153136 raghav.blacklist1 H June 27, 2019, 8:58 a.m. OK GNU C++14 TESTS 70 30 0 2200
56460536 Ajit. H July 3, 2019, 6:35 a.m. OK GNU C++14 TESTS 70 30 102400 2200
65709918 vjudge2 H Nov. 25, 2019, 1:58 p.m. OK GNU C++14 TESTS 70 30 102400 2200
57953649 rishabh.ranjan H July 29, 2019, 5:39 p.m. OK GNU C++14 TESTS 70 30 102400 2200
56760635 K_K H July 9, 2019, 3:43 p.m. OK GNU C++14 TESTS 70 30 102400 2200
56746248 hongye123456 H July 9, 2019, 9:51 a.m. OK GNU C++14 TESTS 70 30 102400 2200
56684539 aviroop123 H July 7, 2019, 9:01 p.m. OK GNU C++14 TESTS 70 30 102400 2200
56309516 vjudge5 H June 30, 2019, 1:58 p.m. OK GNU C++14 TESTS 70 30 102400 2200
56233126 gupta_samarth H June 28, 2019, 3:02 p.m. OK GNU C++14 TESTS 70 30 102400 2200
56170459 peterr H June 27, 2019, 4:16 p.m. OK GNU C++17 TESTS 70 15 102400 2200
65703069 vjudge5 H Nov. 25, 2019, 11:34 a.m. OK GNU C++17 TESTS 70 15 102400 2200
56187759 tarun360 H June 28, 2019, 5:57 a.m. OK GNU C++17 TESTS 70 15 204800 2200
66407159 kgcurry59 H Dec. 6, 2019, 2:03 p.m. OK GNU C++17 TESTS 70 15 307200 2200
57768520 Ptolemy_314 H July 25, 2019, 10:25 p.m. OK GNU C++17 TESTS 70 30 102400 2200
56786758 Stepavly H July 10, 2019, 8:46 a.m. OK GNU C++17 TESTS 70 30 102400 2200
56518823 vvvb H July 4, 2019, 2:02 p.m. OK GNU C++17 TESTS 70 30 102400 2200
61198498 the_mist H Sept. 24, 2019, 6:43 a.m. OK GNU C++17 TESTS 70 30 102400 2200
60467031 Monogon H Sept. 13, 2019, 2:32 a.m. OK GNU C++17 TESTS 70 30 102400 2200
60458078 ryan10bansal H Sept. 12, 2019, 6:57 p.m. OK GNU C++17 TESTS 70 30 102400 2200
64124899 dyhu083 H Nov. 3, 2019, 4:07 a.m. OK Java 8 TESTS 70 109 0 2200
59499672 o.radwan H Aug. 26, 2019, 1:52 a.m. OK Java 8 TESTS 70 109 0 2200
58168982 hhh12345 H Aug. 2, 2019, 10:23 a.m. OK Java 8 TESTS 70 124 0 2200
63767199 dyhu083 H Oct. 30, 2019, 6:39 a.m. OK Java 8 TESTS 70 124 0 2200
61965369 tusharjape007 H Oct. 6, 2019, 8:40 a.m. OK Java 8 TESTS 70 124 0 2200
61964966 tusharjape007 H Oct. 6, 2019, 8:34 a.m. OK Java 8 TESTS 70 124 0 2200
61378512 applemelon H Sept. 27, 2019, 4:52 p.m. OK Java 8 TESTS 70 124 0 2200
59499981 o.radwan H Aug. 26, 2019, 2:05 a.m. OK Java 8 TESTS 70 124 0 2200
57980945 Hemose H July 30, 2019, 9:22 a.m. OK Java 8 TESTS 70 124 0 2200
57973756 Hemose H July 30, 2019, 6:58 a.m. OK Java 8 TESTS 70 124 0 2200
60055897 cidgeedeng H Sept. 5, 2019, 4:07 a.m. OK Kotlin TESTS 70 124 0 2200
56555094 harryoooooooooo H July 5, 2019, 11:57 a.m. OK Kotlin TESTS 70 155 102400 2200
56160759 Guliash H June 27, 2019, 12:14 p.m. OK Kotlin TESTS 70 264 819200 2200
66223775 vjudge3 H Dec. 3, 2019, 11:47 a.m. OK MS C++ TESTS 70 31 102400 2200
65473945 vjudge2 H Nov. 21, 2019, 9:20 a.m. OK MS C++ TESTS 70 31 102400 2200
57181187 vjudge2 H July 17, 2019, 7:18 a.m. OK MS C++ TESTS 70 31 102400 2200
56181792 vjudge2 H June 28, 2019, 12:37 a.m. OK MS C++ TESTS 70 31 204800 2200
66311855 vjudge4 H Dec. 5, 2019, 11:43 a.m. OK MS C++ TESTS 70 31 307200 2200
56276143 S.K H June 29, 2019, 2:21 p.m. OK MS C++ TESTS 70 46 102400 2200
59560648 GeKa H Aug. 27, 2019, 8:21 a.m. OK MS C++ 2017 TESTS 70 31 102400 2200
56184537 xsc H June 28, 2019, 3:30 a.m. OK MS C++ 2017 TESTS 70 31 102400 2200
56166055 0-jij-0 H June 27, 2019, 2:21 p.m. OK MS C++ 2017 TESTS 70 31 102400 2200
56809583 pseuda H July 10, 2019, 3:26 p.m. OK MS C++ 2017 TESTS 70 31 8294400 2200
56425645 eg322 H July 2, 2019, 9:28 a.m. OK PascalABC.NET TESTS 70 326 819200 2200
57805295 gampu H July 26, 2019, 2:55 p.m. OK PyPy 2 TESTS 70 139 1228800 2200
57461487 avuu H July 21, 2019, 1:50 p.m. OK PyPy 2 TESTS 70 139 1228800 2200
56154109 yumtam H June 27, 2019, 9:25 a.m. OK PyPy 2 TESTS 70 170 2150400 2200
56286103 shehebe H June 29, 2019, 7:41 p.m. OK PyPy 2 TESTS 70 171 3379200 2200
65685300 arp106 H Nov. 24, 2019, 10:31 p.m. OK PyPy 3 TESTS 70 155 1843200 2200
58223975 Not-Afraid H Aug. 3, 2019, 1:42 p.m. OK PyPy 3 TESTS 70 155 2867200 2200
65684503 arp106 H Nov. 24, 2019, 9:42 p.m. OK PyPy 3 TESTS 70 155 2969600 2200
56179977 _apurv_ H June 27, 2019, 10:17 p.m. OK PyPy 3 TESTS 70 156 2560000 2200
57701548 SaYami H July 24, 2019, 6:03 p.m. OK PyPy 3 TESTS 70 156 2969600 2200
65685396 arp106 H Nov. 24, 2019, 10:37 p.m. OK PyPy 3 TESTS 70 171 1843200 2200
56166226 Mustang98 H June 27, 2019, 2:25 p.m. OK PyPy 3 TESTS 70 171 3174400 2200
59690019 INMAK H Aug. 30, 2019, 5:25 a.m. OK PyPy 3 TESTS 70 171 3379200 2200
64167334 lclpsoz H Nov. 3, 2019, 4:51 p.m. OK PyPy 3 TESTS 70 171 3481600 2200
56180771 Pokeylope H June 27, 2019, 11:17 p.m. OK PyPy 3 TESTS 70 186 2355200 2200
57805314 avuu H July 26, 2019, 2:55 p.m. OK Python 2 TESTS 70 186 102400 2200
57549266 Helli.code H July 22, 2019, 4:55 p.m. OK Python 2 TESTS 70 233 102400 2200
57941060 -Morass- H July 29, 2019, 12:36 p.m. OK Python 2 TESTS 70 249 409600 2200
56167823 La_Lee H June 27, 2019, 3:03 p.m. OK Python 3 TESTS 70 109 512000 2200
64747511 Mojumbo H Nov. 12, 2019, 2:03 p.m. OK Python 3 TESTS 70 124 307200 2200
64747499 vjudge2 H Nov. 12, 2019, 2:03 p.m. OK Python 3 TESTS 70 124 307200 2200
56158290 joe_joe H June 27, 2019, 11:16 a.m. OK Python 3 TESTS 70 390 1843200 2200
57595591 takakin H July 23, 2019, 1:49 p.m. OK Python 3 TESTS 70 436 307200 2200
56266404 kobae964 H June 29, 2019, 10:04 a.m. OK Rust TESTS 70 46 409600 2200

remove filters

Back to search problems