Codeforces Round 394 (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
761 Codeforces Round 394 (Div. 2) FINISHED False 7200 245949899 Jan. 31, 2017, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5886 ) C Dasha and Password PROGRAMMING brute force dp implementation 1600

B"After overcoming the stairs Dasha came to classes. She needed to write a password to begin her classes. The password is a string of length n which satisfies the following requirements: Considering that these are programming classes it is not easy to write the password. For each character of the password we have a fixed string of length m, on each of these n strings there is a pointer on some character. The i-th character displayed on the screen is the pointed character in the i-th string. Initially, all pointers are on characters with indexes 1 in the corresponding strings (all positions are numbered starting from one). During one operation Dasha can move a pointer in one string one character to the left or to the right. Strings are cyclic, it means that when we move the pointer which is on the character with index 1 to the left, it moves to the character with the index m, and when we move it to the right from the position m it moves to the position 1. You need to determine the minimum number of operations necessary to make the string displayed on the screen a valid password. The first line contains two integers n, m (3 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8950, xe2 x80 x891 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8950) -- the length of the password and the length of strings which are assigned to password symbols. Each of the next n lines contains the string which is assigned to the i-th symbol of the password string. Its length is m, it consists of digits, lowercase English letters, and characters '#', '*' or '&'. You have such input data that you can always get a valid password. Print one integer -- the minimum number of operations which is necessary to make the string, which is displayed on the screen, a valid password. In the first test it is necessary to move the pointer of the third string to one left to get the optimal answer. In the second test one of possible algorithms will be: "...

Tutorials

Codeforces Round #394 (Div. 2) [Editorial]

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
24314010 ruban C Jan. 31, 2017, 3:53 p.m. OK Delphi TESTS 52 15 18636800 1600
30897072 wuyiqi C Oct. 1, 2017, 2:58 a.m. OK FPC TESTS 52 15 102400 1600
30896284 vjudge1 C Oct. 1, 2017, 1:56 a.m. OK FPC TESTS 52 15 102400 1600
30897211 vjudge1 C Oct. 1, 2017, 3:09 a.m. OK FPC TESTS 52 15 204800 1600
24395992 st.matskevich C Feb. 2, 2017, 8:37 p.m. OK FPC TESTS 52 15 1740800 1600
24364139 bzh C Feb. 2, 2017, 12:33 p.m. OK FPC TESTS 52 15 1740800 1600
24316457 kmc1987g2002 C Jan. 31, 2017, 4:09 p.m. OK FPC TESTS 52 15 1740800 1600
24314408 prosmgeorg C Jan. 31, 2017, 3:55 p.m. OK FPC TESTS 52 15 1740800 1600
24312591 Sunray_Gleam C Jan. 31, 2017, 3:45 p.m. OK FPC TESTS 52 15 1740800 1600
24432878 vladKB1 C Feb. 4, 2017, 1:23 p.m. OK FPC TESTS 52 15 1740800 1600
24825098 tin1412 C Feb. 20, 2017, 3:25 p.m. OK FPC TESTS 52 15 1740800 1600
25720064 andra1782 C March 22, 2017, 7:02 p.m. OK GNU C TESTS 52 15 1843200 1600
25599028 rares1012 C March 18, 2017, 11:45 a.m. OK GNU C TESTS 52 15 1843200 1600
24357168 KinKong1 C Feb. 2, 2017, 1:47 a.m. OK GNU C TESTS 52 15 1843200 1600
24318749 c-and-j C Jan. 31, 2017, 4:27 p.m. OK GNU C TESTS 52 15 1843200 1600
24317049 Yuri123581321 C Jan. 31, 2017, 4:13 p.m. OK GNU C TESTS 52 15 1843200 1600
24316904 SlinkyMagic8427 C Jan. 31, 2017, 4:12 p.m. OK GNU C TESTS 52 15 1843200 1600
24316430 kuritsa C Jan. 31, 2017, 4:08 p.m. OK GNU C TESTS 52 15 1843200 1600
25599064 rares1012 C March 18, 2017, 11:47 a.m. OK GNU C TESTS 52 15 1843200 1600
26166441 Dragon_fxl C April 6, 2017, 10:07 a.m. OK GNU C TESTS 52 15 1945600 1600
28926389 vjudge1 C July 27, 2017, 9:18 a.m. OK GNU C TESTS 52 15 1945600 1600
29684785 vjudge4 C Aug. 22, 2017, 2 p.m. OK GNU C++ TESTS 52 15 0 1600
32292078 SebaMarin C Nov. 13, 2017, 6:37 p.m. OK GNU C++ TESTS 52 15 0 1600
32098035 Flying_Dragon_02 C Nov. 6, 2017, 2:16 p.m. OK GNU C++ TESTS 52 15 0 1600
30896778 vjudge2 C Oct. 1, 2017, 2:37 a.m. OK GNU C++ TESTS 52 15 0 1600
30896763 jiaangk_ C Oct. 1, 2017, 2:36 a.m. OK GNU C++ TESTS 52 15 0 1600
30777138 WSPZZ5 C Sept. 27, 2017, 12:47 p.m. OK GNU C++ TESTS 52 15 0 1600
30294533 Officer_K C Sept. 12, 2017, 7:46 p.m. OK GNU C++ TESTS 52 15 0 1600
30266700 vjudge1 C Sept. 11, 2017, 1:33 p.m. OK GNU C++ TESTS 52 15 0 1600
30213084 sazid_kuet C Sept. 8, 2017, 9:13 p.m. OK GNU C++ TESTS 52 15 0 1600
29844670 vjudge3 C Aug. 28, 2017, noon OK GNU C++ TESTS 52 15 0 1600
51288047 hongzhiyin C March 14, 2019, 8:29 a.m. OK GNU C11 TESTS 52 31 0 1600
34337980 vjudge5 C Jan. 20, 2018, 4:26 a.m. OK GNU C11 TESTS 52 31 1843200 1600
30482982 kristja6 C Sept. 18, 2017, 7:17 p.m. OK GNU C++11 TESTS 52 15 0 1600
32423628 Bengal_Tiger C Nov. 18, 2017, 7:37 a.m. OK GNU C++11 TESTS 52 15 0 1600
31085790 buaacai C Oct. 6, 2017, 4:30 p.m. OK GNU C++11 TESTS 52 15 0 1600
31002429 PEDY4000 C Oct. 4, 2017, 8:13 p.m. OK GNU C++11 TESTS 52 15 0 1600
30814882 boundless C Sept. 28, 2017, 7:45 p.m. OK GNU C++11 TESTS 52 15 0 1600
30691155 Diegogrc C Sept. 24, 2017, 9:44 p.m. OK GNU C++11 TESTS 52 15 0 1600
30409281 KK_Mr.BEAN C Sept. 17, 2017, 4:07 a.m. OK GNU C++11 TESTS 52 15 0 1600
30306260 Jayzhang C Sept. 13, 2017, 12:07 p.m. OK GNU C++11 TESTS 52 15 0 1600
30303827 muht C Sept. 13, 2017, 10:14 a.m. OK GNU C++11 TESTS 52 15 0 1600
30016194 wowoto9772 C Sept. 2, 2017, 3:42 p.m. OK GNU C++11 TESTS 52 15 0 1600
32043331 kooljais24 C Nov. 4, 2017, 5:47 a.m. OK GNU C++14 TESTS 52 15 0 1600
31987712 rishi_07 d_skyhawk nky_007 C Nov. 2, 2017, 5:25 p.m. OK GNU C++14 TESTS 52 15 0 1600
32521516 bash C Nov. 21, 2017, 10:02 a.m. OK GNU C++14 TESTS 52 15 0 1600
31733907 edilkulzhabay C Oct. 26, 2017, 9:41 a.m. OK GNU C++14 TESTS 52 15 0 1600
31092894 mohammadmgh77 C Oct. 6, 2017, 8:32 p.m. OK GNU C++14 TESTS 52 15 0 1600
30993227 naij C Oct. 4, 2017, 1:33 p.m. OK GNU C++14 TESTS 52 15 0 1600
55736898 Black_hat123 C June 19, 2019, 4:49 a.m. OK GNU C++14 TESTS 52 15 0 1600
49299383 Pbicem C Feb. 1, 2019, 1:46 a.m. OK GNU C++14 TESTS 52 15 0 1600
32521366 agoli1 C Nov. 21, 2017, 9:56 a.m. OK GNU C++14 TESTS 52 15 0 1600
32037812 melody00 ak_1andonly C Nov. 3, 2017, 9:47 p.m. OK GNU C++14 TESTS 52 15 0 1600
39353507 Wei.Jin C June 18, 2018, 10:35 a.m. OK GNU C++17 TESTS 52 15 0 1600
49199414 ritvik_sangwan C Jan. 30, 2019, 11:53 a.m. OK GNU C++17 TESTS 52 15 819200 1600
62412622 StanaAndrei C Oct. 12, 2019, 10:47 a.m. OK GNU C++17 TESTS 52 30 0 1600
68369884 smit.mangukiya C Jan. 7, 2020, 5:20 p.m. OK GNU C++17 TESTS 52 30 0 1600
67207489 hdsingh C Dec. 19, 2019, 12:56 p.m. OK GNU C++17 TESTS 52 30 0 1600
66320839 DarkScoCu C Dec. 5, 2019, 1:58 p.m. OK GNU C++17 TESTS 52 30 0 1600
64735452 _lucifer_ C Nov. 12, 2019, 10:08 a.m. OK GNU C++17 TESTS 52 30 0 1600
58949826 TselmegKh C Aug. 17, 2019, 10:31 a.m. OK GNU C++17 TESTS 52 30 0 1600
52602114 Vanishment C April 11, 2019, 12:24 p.m. OK GNU C++17 TESTS 52 30 0 1600
47849758 Not-Afraid C Jan. 2, 2019, 4:57 p.m. OK GNU C++17 TESTS 52 30 0 1600
34341307 shmily092 C Jan. 20, 2018, 6:42 a.m. OK GNU C++17 Diagnostics TESTS 52 1045 101785600 1600
27293417 megaspazz C May 23, 2017, 3:31 a.m. OK Go TESTS 52 15 18124800 1600
24313334 smalex69 C Jan. 31, 2017, 3:49 p.m. OK Go TESTS 52 30 24883200 1600
24333694 goC C Feb. 1, 2017, 5:46 a.m. OK Go TESTS 52 31 23244800 1600
24314383 cojna C Jan. 31, 2017, 3:55 p.m. OK Haskell TESTS 52 15 44851200 1600
24609386 rr_ C Feb. 12, 2017, 1:20 p.m. OK Haskell TESTS 52 30 53248000 1600
24614311 rr_ C Feb. 12, 2017, 5:59 p.m. OK Haskell TESTS 52 31 53452800 1600
24352699 sl0th C Feb. 1, 2017, 6:53 p.m. OK Haskell TESTS 52 46 53248000 1600
69957688 NayaWala C Feb. 1, 2020, 10:36 a.m. OK Java 11 TESTS 52 202 0 1600
30786066 Jeel_Vaishnav C Sept. 27, 2017, 6:10 p.m. OK Java 8 TESTS 52 109 0 1600
62641107 maheshwari29 C Oct. 15, 2019, 6:11 p.m. OK Java 8 TESTS 52 109 0 1600
55857152 ronaldocr7 C June 21, 2019, 7:34 a.m. OK Java 8 TESTS 52 109 0 1600
47512278 Mooncrater C Dec. 26, 2018, 7:24 a.m. OK Java 8 TESTS 52 109 0 1600
30785896 Jeel_Vaishnav C Sept. 27, 2017, 6:03 p.m. OK Java 8 TESTS 52 109 0 1600
29805938 Apptica asutoshrana Altaireon C Aug. 26, 2017, 12:16 p.m. OK Java 8 TESTS 52 109 0 1600
27330468 kocko C May 25, 2017, 6:29 a.m. OK Java 8 TESTS 52 109 0 1600
27172180 vjudge4 C May 17, 2017, 4:49 a.m. OK Java 8 TESTS 52 109 0 1600
24316331 intrepidcoder C Jan. 31, 2017, 4:08 p.m. OK Java 8 TESTS 52 109 20377600 1600
24314617 RAMBO_tejasv C Jan. 31, 2017, 3:57 p.m. OK Java 8 TESTS 52 109 20480000 1600
24355441 lionvs13 C Feb. 1, 2017, 9:56 p.m. OK JavaScript TESTS 52 46 6860800 1600
24325906 ramil.agger C Jan. 31, 2017, 7:38 p.m. OK Kotlin TESTS 52 249 22732800 1600
24313980 artsin666 C Jan. 31, 2017, 3:52 p.m. OK MS C# TESTS 52 61 9113600 1600
24328295 kembr1dzh C Jan. 31, 2017, 9:55 p.m. OK MS C# TESTS 52 62 9113600 1600
24313165 mircea85 C Jan. 31, 2017, 3:48 p.m. OK MS C# TESTS 52 62 9113600 1600
24317657 GPV C Jan. 31, 2017, 4:17 p.m. OK MS C# TESTS 52 62 11468800 1600
24315862 pomjuice C Jan. 31, 2017, 4:05 p.m. OK MS C# TESTS 52 62 11468800 1600
24420709 _SHREDDER_ C Feb. 3, 2017, 9:23 p.m. OK MS C# TESTS 52 77 11264000 1600
24334511 Sollex C Feb. 1, 2017, 6:36 a.m. OK MS C# TESTS 52 93 11468800 1600
24360673 Mem C Feb. 2, 2017, 9:39 a.m. OK MS C# TESTS 52 108 11468800 1600
24322339 fr0st C Jan. 31, 2017, 5:50 p.m. OK MS C# TESTS 52 108 11468800 1600
24320626 og.kostya C Jan. 31, 2017, 5:16 p.m. OK MS C# TESTS 52 108 11571200 1600
27580826 Volpe C June 5, 2017, 10:39 a.m. OK MS C++ TESTS 52 15 204800 1600
27363771 egj1996 C May 26, 2017, 8:56 p.m. OK MS C++ TESTS 52 15 204800 1600
28876424 somnusM C July 25, 2017, 12:59 p.m. OK MS C++ TESTS 52 15 1945600 1600
36076577 vjudge5 C March 8, 2018, 4:12 p.m. OK MS C++ TESTS 52 15 2048000 1600
28817449 vjudge5 C July 24, 2017, 7:20 a.m. OK MS C++ TESTS 52 15 2048000 1600
28809498 vjudge3 C July 23, 2017, 11:58 p.m. OK MS C++ TESTS 52 15 2048000 1600
28641557 scorpiowf C July 17, 2017, 1:53 p.m. OK MS C++ TESTS 52 15 2048000 1600
26130767 RCG C April 4, 2017, 7:25 p.m. OK MS C++ TESTS 52 15 2048000 1600
25458021 buttercat C March 13, 2017, 4:20 p.m. OK MS C++ TESTS 52 15 2048000 1600
25447153 Ally0729 C March 13, 2017, 5:27 a.m. OK MS C++ TESTS 52 15 2048000 1600
24311583 314eter C Jan. 31, 2017, 3:40 p.m. OK Ocaml TESTS 52 15 3891200 1600
56478841 Keldante C July 3, 2019, 3 p.m. OK PHP TESTS 52 62 409600 1600
25891072 mayakin C March 29, 2017, 8:40 a.m. OK PHP TESTS 52 78 6041600 1600
24316350 NicolasK C Jan. 31, 2017, 4:08 p.m. OK PyPy 2 TESTS 52 78 22118400 1600
32994644 xiaowuc1 C Dec. 7, 2017, 7:44 a.m. OK PyPy 2 TESTS 52 93 22323200 1600
25756078 ragingbull C March 23, 2017, 7:02 p.m. OK PyPy 2 TESTS 52 109 22732800 1600
24332960 ragingbull C Feb. 1, 2017, 4:47 a.m. OK PyPy 2 TESTS 52 124 22835200 1600
24420684 Eeyore C Feb. 3, 2017, 9:20 p.m. OK PyPy 2 TESTS 52 124 23040000 1600
39267919 aeternalis1 C June 15, 2018, 1:47 p.m. OK PyPy 2 TESTS 52 139 921600 1600
24313140 cfcfs C Jan. 31, 2017, 3:48 p.m. OK PyPy 2 TESTS 52 139 22835200 1600
41506519 Onesh0t C Aug. 11, 2018, 9:01 p.m. OK PyPy 2 TESTS 52 155 5017600 1600
24341812 alexwice C Feb. 1, 2017, 11:26 a.m. OK PyPy 2 TESTS 52 156 23961600 1600
24316557 har_vi C Jan. 31, 2017, 4:09 p.m. OK PyPy 2 TESTS 52 327 29900800 1600
35385626 Marble1 C Feb. 17, 2018, 8:16 a.m. OK PyPy 3 TESTS 52 108 20377600 1600
59902589 ananya17020 karan2dec avyaktg98 C Sept. 2, 2019, 2:10 p.m. OK PyPy 3 TESTS 52 155 2457600 1600
27178906 sonya123 C May 17, 2017, 12:12 p.m. OK PyPy 3 TESTS 52 155 2457600 1600
66146371 Mohamed_Ayman C Dec. 1, 2019, 4:45 p.m. OK PyPy 3 TESTS 52 171 2252800 1600
24321470 Vosatorp C Jan. 31, 2017, 5:32 p.m. OK PyPy 3 TESTS 52 187 26214400 1600
46528696 homoeconomicus C Dec. 3, 2018, 2:16 a.m. OK PyPy 3 TESTS 52 202 921600 1600
24334641 Yash_ C Feb. 1, 2017, 6:44 a.m. OK PyPy 3 TESTS 52 202 24576000 1600
24322731 yigitozen C Jan. 31, 2017, 5:59 p.m. OK PyPy 3 TESTS 52 264 26112000 1600
42330725 petiteteaparty C Sept. 1, 2018, 9:44 a.m. OK PyPy 3 TESTS 52 311 5427200 1600
27179200 sonya123 C May 17, 2017, 12:26 p.m. OK PyPy 3 TESTS 52 608 10752000 1600
24313384 coderbd C Jan. 31, 2017, 3:49 p.m. OK Python 2 TESTS 52 62 4608000 1600
24326447 slonmudrosti C Jan. 31, 2017, 7:57 p.m. OK Python 2 TESTS 52 77 4608000 1600
24455432 Butane C Feb. 5, 2017, 4:33 p.m. OK Python 2 TESTS 52 77 4710400 1600
24352749 ManikantanV C Feb. 1, 2017, 6:56 p.m. OK Python 2 TESTS 52 77 4710400 1600
24329832 BIGCHENG C Feb. 1, 2017, 12:02 a.m. OK Python 2 TESTS 52 77 4710400 1600
24327536 Spartach C Jan. 31, 2017, 8:58 p.m. OK Python 2 TESTS 52 77 4710400 1600
24323130 denny_sem C Jan. 31, 2017, 6:08 p.m. OK Python 2 TESTS 52 92 4915200 1600
24315192 piranha C Jan. 31, 2017, 4:01 p.m. OK Python 2 TESTS 52 93 4608000 1600
24325515 aman_shahi2 C Jan. 31, 2017, 7:23 p.m. OK Python 2 TESTS 52 108 5017600 1600
25030857 whn6325689 C Feb. 26, 2017, 7:47 a.m. OK Python 2 TESTS 52 124 4608000 1600
24314799 dusja.ds C Jan. 31, 2017, 3:58 p.m. OK Python 3 TESTS 52 62 4915200 1600
33329321 arpit040199 C Dec. 17, 2017, 5:36 a.m. OK Python 3 TESTS 52 62 5632000 1600
24565906 Yut0 C Feb. 10, 2017, 8:50 a.m. OK Python 3 TESTS 52 77 4915200 1600
24321452 Pulitzer C Jan. 31, 2017, 5:32 p.m. OK Python 3 TESTS 52 77 4915200 1600
24315935 sam.g C Jan. 31, 2017, 4:05 p.m. OK Python 3 TESTS 52 77 4915200 1600
24321440 nanae1914 C Jan. 31, 2017, 5:31 p.m. OK Python 3 TESTS 52 92 4915200 1600
24319409 xarshila_ C Jan. 31, 2017, 4:33 p.m. OK Python 3 TESTS 52 93 4915200 1600
24314555 samstikhin C Jan. 31, 2017, 3:57 p.m. OK Python 3 TESTS 52 93 4915200 1600
26999984 merolish C May 10, 2017, 4:37 p.m. OK Python 3 TESTS 52 109 0 1600
24315178 alexeyqu C Jan. 31, 2017, 4:01 p.m. OK Python 3 TESTS 52 124 4608000 1600
24460948 ykmr1224 C Feb. 6, 2017, 1:29 a.m. OK Ruby TESTS 52 124 6348800 1600
24335112 tkain C Feb. 1, 2017, 7:08 a.m. OK Ruby TESTS 52 140 6553600 1600
24312846 mio_h C Jan. 31, 2017, 3:46 p.m. OK Rust TESTS 52 15 1536000 1600

remove filters

Back to search problems