Codeforces Round 385 (Div. 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
744 Codeforces Round 385 (Div. 1) FINISHED False 7200 255533124 Dec. 17, 2016, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 143 ) E Hongcow Masters the Cyclic Shift PROGRAMMING strings two pointers 3100

B'Hongcow 's teacher heard that Hongcow had learned about the cyclic shift, and decided to set the following problem for him. You are given a list of n strings s1, xe2 x80 x89s2, xe2 x80 x89..., xe2 x80 x89sn contained in the list A. A list X of strings is called stable if the following condition holds. First, a message is defined as a concatenation of some elements of the list X. You can use an arbitrary element as many times as you want, and you may concatenate these elements in any arbitrary order. Let SX denote the set of of all messages you can construct from the list. Of course, this set has infinite size if your list is nonempty. Call a single message good if the following conditions hold: The list X is called stable if and only if every element of SX is good. Let f(L) be 1 if L is a stable list, and 0 otherwise. Find the sum of f(L) where L is a nonempty contiguous sublist of A (there are contiguous sublists in total). The first line of input will contain a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8930), denoting the number of strings in the list. The next n lines will each contain a string si (). Print a single integer, the number of nonempty contiguous sublists that are stable. For the first sample, there are 10 sublists to consider. Sublists ["a", "ab", "b"], ["ab", "b", "bba"], and ["a", "ab", "b", "bba"] are not stable. The other seven sublists are stable. For example, X = ["a", "ab", "b"] is not stable, since the message "ab" + "ab" = "abab" has four cyclic shifts ["abab", "baba", "abab", "baba"], which are all elements of SX. '...

Tutorials

Codeforces Round #385 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
26830543 jiyutian E May 4, 2017, 8:21 a.m. OK GNU C++ TESTS 164 373 56832000 3100
23168862 jzymts E Dec. 20, 2016, 3:55 a.m. OK GNU C++ TESTS 164 390 31846400 3100
41590779 Scut82 E Aug. 14, 2018, 1:55 p.m. OK GNU C++ TESTS 164 764 22732800 3100
31846998 keko37 E Oct. 28, 2017, 5:57 p.m. OK GNU C++ TESTS 164 1029 67686400 3100
31846943 keko37 E Oct. 28, 2017, 5:55 p.m. OK GNU C++ TESTS 164 1076 67686400 3100
23660893 Dylans E Jan. 9, 2017, 6:32 a.m. OK GNU C++ TESTS 164 1326 74342400 3100
23660878 Dylans E Jan. 9, 2017, 6:31 a.m. OK GNU C++ TESTS 164 1357 74342400 3100
23221256 liujunhao E Dec. 22, 2016, 9:34 a.m. OK GNU C++ TESTS 164 1980 29388800 3100
23140219 syc1999 E Dec. 19, 2016, 1:50 p.m. OK GNU C++ TESTS 164 2791 64000000 3100
25290834 vjudge1 E March 6, 2017, 11:55 a.m. OK GNU C++ TESTS 164 4914 199270400 3100
59833347 HeHere E Sept. 1, 2019, 1:45 a.m. OK GNU C++11 TESTS 164 140 23654400 3100
23355806 Ali.Pi E Dec. 27, 2016, 9:05 a.m. OK GNU C++11 TESTS 164 156 10752000 3100
23070592 PavelKunyavskiy E Dec. 17, 2016, 6:32 p.m. OK GNU C++11 TESTS 164 156 10752000 3100
40983002 ReaLNero1 E July 30, 2018, 6:40 p.m. OK GNU C++11 TESTS 164 171 8704000 3100
23332468 BSBandme E Dec. 26, 2016, 4:32 a.m. OK GNU C++11 TESTS 164 218 128102400 3100
23095057 data_h E Dec. 18, 2016, 11:51 a.m. OK GNU C++11 TESTS 164 249 27750400 3100
57877869 lopare E July 28, 2019, 6:23 a.m. OK GNU C++11 TESTS 164 280 56934400 3100
57813414 py_ultron E July 26, 2019, 6:29 p.m. OK GNU C++11 TESTS 164 280 56934400 3100
65336271 YangDavid E Nov. 19, 2019, 9:02 a.m. OK GNU C++11 TESTS 164 280 160358400 3100
23071342 tourist E Dec. 17, 2016, 6:49 p.m. OK GNU C++11 TESTS 164 358 162304000 3100
59333438 Scut82 E Aug. 23, 2019, 2:55 a.m. OK GNU C++14 TESTS 164 124 26624000 3100
59333409 Scut82 E Aug. 23, 2019, 2:54 a.m. OK GNU C++14 TESTS 164 155 26624000 3100
23358771 Ali.Pi E Dec. 27, 2016, 12:20 p.m. OK GNU C++14 TESTS 164 156 10547200 3100
23073738 MrDindows E Dec. 17, 2016, 10:12 p.m. OK GNU C++14 TESTS 164 171 38195200 3100
23167668 itu E Dec. 20, 2016, 1:55 a.m. OK GNU C++14 TESTS 164 171 129638400 3100
23201596 WuHongxun E Dec. 21, 2016, 2:33 p.m. OK GNU C++14 TESTS 164 171 148582400 3100
23201424 WuHongxun E Dec. 21, 2016, 2:25 p.m. OK GNU C++14 TESTS 164 171 148582400 3100
34805725 Batman E Feb. 1, 2018, 2:21 p.m. OK GNU C++14 TESTS 164 187 19660800 3100
24789780 DBradac E Feb. 18, 2017, 8:46 p.m. OK GNU C++14 TESTS 164 202 23142400 3100
24789767 DBradac E Feb. 18, 2017, 8:46 p.m. OK GNU C++14 TESTS 164 233 23040000 3100
53301605 Rzepa E April 25, 2019, 9:16 p.m. OK GNU C++17 TESTS 164 124 38400000 3100
64861235 zhouz1 E Nov. 14, 2019, 3:18 a.m. OK GNU C++17 TESTS 164 295 160460800 3100
57157694 Benq E July 16, 2019, 5:28 p.m. OK GNU C++17 TESTS 164 483 11468800 3100
46009274 pawelek1 E Nov. 20, 2018, 7:02 p.m. OK GNU C++17 TESTS 164 810 73011200 3100
23067644 Petr E Dec. 17, 2016, 6:09 p.m. OK Java 8 TESTS 164 1481 40038400 3100
23216494 Los_Angelos_Laycurse E Dec. 22, 2016, 3:16 a.m. OK MS C++ TESTS 164 1933 66560000 3100
23216492 Los_Angelos_Laycurse E Dec. 22, 2016, 3:15 a.m. OK MS C++ TESTS 164 2152 66560000 3100
23216268 Los_Angelos_Laycurse E Dec. 22, 2016, 2:50 a.m. OK MS C++ TESTS 164 2215 66560000 3100
23216300 Los_Angelos_Laycurse E Dec. 22, 2016, 2:54 a.m. OK MS C++ TESTS 164 2402 66560000 3100
23216293 Los_Angelos_Laycurse E Dec. 22, 2016, 2:53 a.m. OK MS C++ TESTS 164 2620 66560000 3100

remove filters

Back to search problems