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 175879487 June 26, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4938 ) E Subsequences (easy version) PROGRAMMING dp graphs implementation shortest paths 2000

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, k <= 100 ) -- 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
56709898 vjudge1 E July 8, 2019, 12:23 p.m. OK Clang++17 Diagnostics TESTS 59 46 2150400 2000
56408285 gauravahlawat81 E July 1, 2019, 8:57 p.m. OK Clang++17 Diagnostics TESTS 59 62 2150400 2000
57970324 ruban E July 30, 2019, 5:37 a.m. OK Delphi TESTS 59 498 8089600 2000
57970534 ruban E July 30, 2019, 5:43 a.m. OK Delphi TESTS 59 514 8089600 2000
57970503 ruban E July 30, 2019, 5:42 a.m. OK Delphi TESTS 59 514 8089600 2000
57970286 ruban E July 30, 2019, 5:36 a.m. OK FPC TESTS 59 842 9216000 2000
56413375 ninety9 E July 2, 2019, 2:29 a.m. OK GNU C11 TESTS 59 31 102400 2000
58070551 MRoy E July 31, 2019, 10:29 a.m. OK GNU C11 TESTS 59 31 102400 2000
56420805 sansen E July 2, 2019, 7:14 a.m. OK GNU C11 TESTS 59 31 102400 2000
56525612 apbondarev E July 4, 2019, 5 p.m. OK GNU C11 TESTS 59 31 2764800 2000
56526658 apbondarev E July 4, 2019, 5:27 p.m. OK GNU C11 TESTS 59 46 2764800 2000
56526448 apbondarev E July 4, 2019, 5:22 p.m. OK GNU C11 TESTS 59 46 2764800 2000
68976144 rures E Jan. 17, 2020, 8:54 a.m. OK GNU C++11 TESTS 59 30 0 2000
57355619 small-white-rabbit E July 20, 2019, 6:09 a.m. OK GNU C++11 TESTS 59 30 0 2000
66642823 zyounan E Dec. 11, 2019, 3:26 p.m. OK GNU C++11 TESTS 59 31 0 2000
65889945 luogu_bot4 E Nov. 28, 2019, 2:38 a.m. OK GNU C++11 TESTS 59 31 0 2000
69456512 vjudge1 E Jan. 24, 2020, 8:52 a.m. OK GNU C++11 TESTS 59 31 0 2000
69160014 FakeRussian E Jan. 19, 2020, 10:23 p.m. OK GNU C++11 TESTS 59 31 0 2000
68903190 Herlo E Jan. 16, 2020, 6:24 a.m. OK GNU C++11 TESTS 59 31 0 2000
67043554 SebVettel E Dec. 16, 2019, 8:32 p.m. OK GNU C++11 TESTS 59 31 0 2000
69493270 TOPCYBERFLOWER E Jan. 25, 2020, 12:57 a.m. OK GNU C++11 TESTS 59 31 0 2000
69684719 vjudge1 E Jan. 28, 2020, 4:39 p.m. OK GNU C++11 TESTS 59 31 0 2000
56759427 CrazyDiamond E July 9, 2019, 3:14 p.m. OK GNU C++14 TESTS 59 15 0 2000
56177986 Bhanu1219 E June 27, 2019, 8:28 p.m. OK GNU C++14 TESTS 59 15 204800 2000
56878482 Ada.Grad.Shil E July 12, 2019, 9:17 a.m. OK GNU C++14 TESTS 59 15 204800 2000
56247182 always_dob E June 28, 2019, 10:19 p.m. OK GNU C++14 TESTS 59 15 204800 2000
56397380 ducluong E July 1, 2019, 3:12 p.m. OK GNU C++14 TESTS 59 15 204800 2000
56180438 Huisung E June 27, 2019, 10:52 p.m. OK GNU C++14 TESTS 59 15 204800 2000
56190531 yukio33 E June 28, 2019, 7:18 a.m. OK GNU C++14 TESTS 59 15 1638400 2000
59940027 we_can_2 E Sept. 3, 2019, 11:07 a.m. OK GNU C++14 TESTS 59 30 102400 2000
59502608 imulan E Aug. 26, 2019, 3:55 a.m. OK GNU C++14 TESTS 59 30 102400 2000
58527376 kevin66654 E Aug. 10, 2019, 7:49 a.m. OK GNU C++14 TESTS 59 30 102400 2000
60467055 Monogon E Sept. 13, 2019, 2:33 a.m. OK GNU C++17 TESTS 59 15 102400 2000
67981858 Mahdi_Shokoufi E Dec. 30, 2019, 7:44 p.m. OK GNU C++17 TESTS 59 15 204800 2000
57975443 shizu E July 30, 2019, 7:32 a.m. OK GNU C++17 TESTS 59 15 204800 2000
57280568 Heyitssourav E July 18, 2019, 12:36 p.m. OK GNU C++17 TESTS 59 15 204800 2000
56169180 qqq17770027225 E June 27, 2019, 3:40 p.m. OK GNU C++17 TESTS 59 15 409600 2000
56293709 xiaoshizhan E June 30, 2019, 3:58 a.m. OK GNU C++17 TESTS 59 15 409600 2000
56163914 gurwika.dev E June 27, 2019, 1:30 p.m. OK GNU C++17 TESTS 59 15 1740800 2000
56171940 __Apocalypse__ E June 27, 2019, 5:05 p.m. OK GNU C++17 TESTS 59 30 0 2000
67940910 ptnk_1215_panaka_13 E Dec. 30, 2019, 12:43 a.m. OK GNU C++17 TESTS 59 30 102400 2000
62451824 _MahmudovJovid_ E Oct. 13, 2019, 4:36 a.m. OK GNU C++17 TESTS 59 30 102400 2000
57101701 hayaalt E July 15, 2019, 1:59 p.m. OK Java 8 TESTS 59 109 0 2000
56814763 mennafadali E July 10, 2019, 6:25 p.m. OK Java 8 TESTS 59 109 0 2000
56746078 gaidash E July 9, 2019, 9:47 a.m. OK Java 8 TESTS 59 109 0 2000
56735238 MubtasimShahriar E July 9, 2019, 4:44 a.m. OK Java 8 TESTS 59 109 0 2000
58642833 GiantTornado E Aug. 12, 2019, 4:31 a.m. OK Java 8 TESTS 59 109 0 2000
63767354 dyhu083 E Oct. 30, 2019, 6:42 a.m. OK Java 8 TESTS 59 109 0 2000
61964470 tusharjape007 E Oct. 6, 2019, 8:27 a.m. OK Java 8 TESTS 59 109 0 2000
58673216 less_than_gray E Aug. 12, 2019, 3:17 p.m. OK Java 8 TESTS 59 109 0 2000
57426944 Oopsimbad E July 20, 2019, 9:01 p.m. OK Java 8 TESTS 59 109 0 2000
57348934 Ahmad E July 20, 2019, 2:07 a.m. OK Java 8 TESTS 59 109 0 2000
60055541 cidgeedeng E Sept. 5, 2019, 3:51 a.m. OK Kotlin TESTS 59 124 0 2000
56555117 harryoooooooooo E July 5, 2019, 11:58 a.m. OK Kotlin TESTS 59 140 102400 2000
56295591 Spheniscine E June 30, 2019, 5:39 a.m. OK Kotlin TESTS 59 155 307200 2000
56160698 Guliash E June 27, 2019, 12:12 p.m. OK Kotlin TESTS 59 155 819200 2000
56579084 NEvOl E July 5, 2019, 4:01 p.m. OK Mono C# TESTS 59 62 5120000 2000
65418686 vjudge5 E Nov. 20, 2019, 8:04 a.m. OK MS C++ TESTS 59 31 0 2000
56191285 solve_hzy E June 28, 2019, 7:44 a.m. OK MS C++ TESTS 59 31 0 2000
66223216 vjudge3 E Dec. 3, 2019, 11:35 a.m. OK MS C++ TESTS 59 31 0 2000
65419358 vjudge4 E Nov. 20, 2019, 8:19 a.m. OK MS C++ TESTS 59 31 0 2000
65436614 vjudge5 E Nov. 20, 2019, 1:35 p.m. OK MS C++ TESTS 59 31 0 2000
56690365 vjudge3 E July 8, 2019, 3:17 a.m. OK MS C++ TESTS 59 31 102400 2000
56276202 S.K E June 29, 2019, 2:22 p.m. OK MS C++ TESTS 59 31 102400 2000
56248742 vjudge2 E June 29, 2019, 12:32 a.m. OK MS C++ TESTS 59 31 102400 2000
59359880 MrBear E Aug. 23, 2019, 2:51 p.m. OK MS C++ TESTS 59 31 102400 2000
56182628 vjudge4 E June 28, 2019, 1:39 a.m. OK MS C++ TESTS 59 31 204800 2000
57580828 ZSTU-2018329621261 E July 23, 2019, 8:48 a.m. OK MS C++ 2017 TESTS 59 31 0 2000
60496575 _Artyom_ E Sept. 13, 2019, 4:38 p.m. OK MS C++ 2017 TESTS 59 31 0 2000
57623757 MIG29 E July 24, 2019, 6:11 a.m. OK MS C++ 2017 TESTS 59 31 0 2000
56384084 wasvlad E July 1, 2019, 9:45 a.m. OK MS C++ 2017 TESTS 59 31 0 2000
56277574 Husne_Matar E June 29, 2019, 3:03 p.m. OK MS C++ 2017 TESTS 59 31 0 2000
56168124 Skeef79 E June 27, 2019, 3:12 p.m. OK MS C++ 2017 TESTS 59 31 0 2000
56163199 xsc E June 27, 2019, 1:11 p.m. OK MS C++ 2017 TESTS 59 31 0 2000
57623670 MIG29 E July 24, 2019, 6:09 a.m. OK MS C++ 2017 TESTS 59 31 102400 2000
57619234 MIG29 E July 24, 2019, 3:30 a.m. OK MS C++ 2017 TESTS 59 31 102400 2000
65421337 vjudge5 E Nov. 20, 2019, 9:02 a.m. OK MS C++ 2017 TESTS 59 31 102400 2000
59593335 angoncal E Aug. 27, 2019, 10:32 p.m. OK PyPy 2 TESTS 59 124 0 2000
57805280 gampu E July 26, 2019, 2:54 p.m. OK PyPy 2 TESTS 59 139 921600 2000
57544168 avuu E July 22, 2019, 4:20 p.m. OK PyPy 2 TESTS 59 139 921600 2000
58629114 ssk497 E Aug. 11, 2019, 6:49 p.m. OK PyPy 2 TESTS 59 140 1126400 2000
56151020 yumtam E June 27, 2019, 8:10 a.m. OK PyPy 2 TESTS 59 171 1740800 2000
56180331 Danimator E June 27, 2019, 10:43 p.m. OK PyPy 2 TESTS 59 187 2252800 2000
56541234 Shinora007 E July 5, 2019, 5:21 a.m. OK PyPy 3 TESTS 59 139 1331200 2000
56231751 koptev E June 28, 2019, 2:31 p.m. OK PyPy 3 TESTS 59 140 1331200 2000
56170456 Canoe E June 27, 2019, 4:16 p.m. OK PyPy 3 TESTS 59 140 1331200 2000
56279005 arun_y99 E June 29, 2019, 3:45 p.m. OK PyPy 3 TESTS 59 140 1433600 2000
56173464 kk17060123123 E June 27, 2019, 5:49 p.m. OK PyPy 3 TESTS 59 140 1433600 2000
56164977 Paixao E June 27, 2019, 1:55 p.m. OK PyPy 3 TESTS 59 140 1433600 2000
56485767 Dake3601 E July 3, 2019, 6:16 p.m. OK PyPy 3 TESTS 59 140 1638400 2000
56405885 MrEmnE E July 1, 2019, 7:20 p.m. OK PyPy 3 TESTS 59 155 1331200 2000
56162615 fahad17049 E June 27, 2019, 12:58 p.m. OK PyPy 3 TESTS 59 155 1945600 2000
68090450 Munchy_1 E Jan. 2, 2020, 5:56 p.m. OK PyPy 3 TESTS 59 155 2150400 2000
57548827 Helli.code E July 22, 2019, 4:48 p.m. OK Python 2 TESTS 59 187 1433600 2000
56180325 Danimator E June 27, 2019, 10:43 p.m. OK Python 2 TESTS 59 202 1433600 2000
57940032 -Morass- E July 29, 2019, 12:15 p.m. OK Python 2 TESTS 59 249 409600 2000
56500454 smit_5300 E July 4, 2019, 6:04 a.m. OK Python 3 TESTS 59 109 1331200 2000
57854450 S.H_try E July 27, 2019, 2:28 p.m. OK Python 3 TESTS 59 109 1433600 2000
56412965 nguyenminhhieu0709 E July 2, 2019, 2:08 a.m. OK Python 3 TESTS 59 124 0 2000
56298583 loayCPS E June 30, 2019, 7:34 a.m. OK Python 3 TESTS 59 124 0 2000
56291574 changhc E June 30, 2019, 1:41 a.m. OK Python 3 TESTS 59 124 0 2000
56279745 tadashiya E June 29, 2019, 4:07 p.m. OK Python 3 TESTS 59 124 0 2000
56264997 Ch_zaqdt E June 29, 2019, 9:29 a.m. OK Python 3 TESTS 59 124 0 2000
56167843 La_Lee E June 27, 2019, 3:04 p.m. OK Python 3 TESTS 59 124 512000 2000
58256598 ScholarlyChives E Aug. 4, 2019, 10:20 a.m. OK Python 3 TESTS 59 124 1331200 2000
56154966 liquidslr E June 27, 2019, 9:46 a.m. OK Python 3 TESTS 59 124 1331200 2000
68230710 nemi_zzz E Jan. 5, 2020, 9:05 a.m. OK Ruby TESTS 59 62 1433600 2000
56266444 kobae964 E June 29, 2019, 10:05 a.m. OK Rust TESTS 59 31 409600 2000
56173147 Peaupote E June 27, 2019, 5:39 p.m. OK Rust TESTS 59 46 5529600 2000

remove filters

Back to search problems