Codeforces Round 129 (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
204 Codeforces Round 129 (Div. 1) FINISHED False 7200 395418587 July 11, 2012, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1187 ) E Little Elephant and Strings PROGRAMMING data structures implementation string suffix structures two pointers 2800

B"The Little Elephant loves strings very much. He has an array a from n strings, consisting of lowercase English letters. Let's number the elements of the array from 1 to n, then let's denote the element number i as ai. For each string ai (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) the Little Elephant wants to find the number of pairs of integers l and r (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89l xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89r xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|ai|) such that substring ai[l... r] is a substring to at least k strings from array a (including the i-th string). Help the Little Elephant solve this problem. If you are not familiar with the basic notation in string problems, you can find the corresponding definitions in the notes. The first line contains two space-separated integers -- n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Next n lines contain array a. The i-th line contains a non-empty string ai, consisting of lowercase English letter. The total length of all strings ai does not exceed 105. On a single line print n space-separated integers -- the i-th number is the answer for string ai. Please, do not use the %lld specifier to read or write 64-bit integers in xd0 xa1++. It is preferred to use the cin, cout streams or the %I64d specifier. Let's assume that you are given string a xe2 x80 x89= xe2 x80 x89a1a2... a|a|, then let's denote the string's length as |a| and the string's i-th character as ai. A substring a[l... r] (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89l xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89r xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|a|) of string a is string alal xe2 x80 x89+ xe2 x80 x891... ar. String a is a substring of string b, if there exists such pair of integers l and r (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89l xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89r xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|b|), that b[l... r] xe2 x80 x89= xe2 x80 x89a."...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
1890672 tourist E July 11, 2012, 5:16 p.m. OK Delphi TESTS 101 1330 74035200 2800
2502642 Nagatoyuki E Nov. 4, 2012, 5:11 p.m. OK FPC TESTS 101 234 26009600 2800
25658691 zhanggengchen E March 20, 2017, 3:42 a.m. OK FPC TESTS 101 1184 119091200 2800
1897806 ACTheory E July 13, 2012, 1:53 p.m. OK FPC TESTS 101 1910 73625600 2800
2754065 luogan E Dec. 12, 2012, 10:34 a.m. OK FPC TESTS 101 2421 21299200 2800
3494965 yedeming E April 9, 2013, 2:34 a.m. OK GNU C++ TESTS 101 78 12288000 2800
2878634 dhh1995 E Jan. 6, 2013, 2:53 p.m. OK GNU C++ TESTS 101 78 12288000 2800
2878575 dhh1995 E Jan. 6, 2013, 2:24 p.m. OK GNU C++ TESTS 101 78 12288000 2800
2668585 pty E Nov. 27, 2012, 1:33 p.m. OK GNU C++ TESTS 101 78 15052800 2800
2804541 BenZ E Dec. 21, 2012, 6:16 p.m. OK GNU C++ TESTS 101 78 18329600 2800
14140861 130705009 E Nov. 8, 2015, 12:29 p.m. OK GNU C++ TESTS 101 92 12083200 2800
5205826 equation314 E Nov. 24, 2013, 4:52 a.m. OK GNU C++ TESTS 101 92 13004800 2800
35612279 erge E Feb. 24, 2018, 12:36 a.m. OK GNU C++ TESTS 101 92 31334400 2800
33914982 l1ll5 E Jan. 5, 2018, 3:39 a.m. OK GNU C++ TESTS 101 92 35020800 2800
33914920 l1ll5 E Jan. 5, 2018, 3:34 a.m. OK GNU C++ TESTS 101 92 36556800 2800
4544417 MinakoKojima E Sept. 23, 2013, 6:08 p.m. OK GNU C++0x TESTS 101 124 39424000 2800
4543080 MinakoKojima E Sept. 23, 2013, 2:28 p.m. OK GNU C++0x TESTS 101 124 53043200 2800
2861518 bakabakashyoshyo E Dec. 31, 2012, 3:12 p.m. OK GNU C++0x TESTS 101 125 11366400 2800
4544485 MinakoKojima E Sept. 23, 2013, 6:20 p.m. OK GNU C++0x TESTS 101 156 39424000 2800
4601282 MinakoKojima E Sept. 28, 2013, 9:48 p.m. OK GNU C++0x TESTS 101 156 47820800 2800
4543996 MinakoKojima E Sept. 23, 2013, 4:52 p.m. OK GNU C++0x TESTS 101 156 53043200 2800
4544453 MinakoKojima E Sept. 23, 2013, 6:14 p.m. OK GNU C++0x TESTS 101 186 39424000 2800
4544567 MinakoKojima E Sept. 23, 2013, 6:33 p.m. OK GNU C++0x TESTS 101 186 39424000 2800
4544513 MinakoKojima E Sept. 23, 2013, 6:26 p.m. OK GNU C++0x TESTS 101 186 39424000 2800
4544928 MinakoKojima E Sept. 23, 2013, 7:38 p.m. OK GNU C++0x TESTS 101 186 41779200 2800
11374059 ShingRay E June 1, 2015, 6:47 a.m. OK GNU C++11 TESTS 101 92 6963200 2800
17121741 freebsdx E April 2, 2016, 2:47 a.m. OK GNU C++11 TESTS 101 92 14336000 2800
61322586 luogu_bot1 E Sept. 26, 2019, 1 p.m. OK GNU C++11 TESTS 101 92 30617600 2800
63764651 vjudge1 E Oct. 30, 2019, 5:41 a.m. OK GNU C++11 TESTS 101 92 40243200 2800
36299991 Serval E March 15, 2018, 12:48 p.m. OK GNU C++11 TESTS 101 92 53452800 2800
55991307 luogu_bot3 E June 24, 2019, 7:48 a.m. OK GNU C++11 TESTS 101 122 30617600 2800
55698018 yyyz04 E June 18, 2019, 1:14 a.m. OK GNU C++11 TESTS 101 122 144486400 2800
46020869 tritanngo99 E Nov. 21, 2018, 7:53 a.m. OK GNU C++11 TESTS 101 124 13004800 2800
15330683 Yuuki-Asuna E Jan. 13, 2016, 12:34 p.m. OK GNU C++11 TESTS 101 124 13004800 2800
50781711 Trespassing E March 4, 2019, 11:41 a.m. OK GNU C++11 TESTS 101 124 27033600 2800
23667849 Ali.Pi E Jan. 9, 2017, 5:20 p.m. OK GNU C++14 TESTS 101 92 14131200 2800
56503759 NotNight E July 4, 2019, 7:31 a.m. OK GNU C++14 TESTS 101 92 18432000 2800
27717254 RNS_JKS E June 11, 2017, 8:10 a.m. OK GNU C++14 TESTS 101 92 31027200 2800
43595793 I_love_Y_UME E Sept. 30, 2018, 6:58 a.m. OK GNU C++14 TESTS 101 124 30310400 2800
43595787 I_love_Y_UME E Sept. 30, 2018, 6:58 a.m. OK GNU C++14 TESTS 101 124 30310400 2800
27755276 RNS_JKS E June 13, 2017, 12:24 p.m. OK GNU C++14 TESTS 101 154 31129600 2800
48482959 hychyc E Jan. 17, 2019, 7 a.m. OK GNU C++14 TESTS 101 154 35532800 2800
49553640 sava-cska E Feb. 7, 2019, 8:04 a.m. OK GNU C++14 TESTS 101 156 19558400 2800
33527056 VastoLorde95 E Dec. 23, 2017, 6:19 a.m. OK GNU C++14 TESTS 101 156 23040000 2800
33527107 VastoLorde95 E Dec. 23, 2017, 6:21 a.m. OK GNU C++14 TESTS 101 156 23040000 2800
55991226 Fulisike E June 24, 2019, 7:46 a.m. OK GNU C++17 TESTS 101 154 30720000 2800
50807575 KillerX E March 5, 2019, 6:33 a.m. OK GNU C++17 TESTS 101 154 34406400 2800
65766961 a_r_s E Nov. 26, 2019, 6:25 p.m. OK GNU C++17 TESTS 101 156 28876800 2800
62462685 rabster E Oct. 13, 2019, 8:49 a.m. OK GNU C++17 TESTS 101 186 30003200 2800
45942501 yhchang3 E Nov. 18, 2018, 8:22 p.m. OK GNU C++17 TESTS 101 218 25088000 2800
40852971 huangzhen E July 27, 2018, 3:39 p.m. OK GNU C++17 TESTS 101 248 28672000 2800
40852947 vjudge1 E July 27, 2018, 3:38 p.m. OK GNU C++17 TESTS 101 248 28672000 2800
62949176 ivan100sic E Oct. 19, 2019, 6:21 p.m. OK GNU C++17 TESTS 101 278 53145600 2800
66502857 satvik007 E Dec. 8, 2019, 1:13 p.m. OK GNU C++17 TESTS 101 310 26419200 2800
68720038 FlowerOfSorrow E Jan. 13, 2020, 3:54 p.m. OK GNU C++17 TESTS 101 312 51507200 2800
1891040 uwi E July 11, 2012, 5:24 p.m. OK Java 6 TESTS 101 480 44441600 2800
1890554 winger E July 11, 2012, 5:13 p.m. OK Java 6 TESTS 101 800 132300800 2800
1894763 yarrr E July 12, 2012, 7:41 a.m. OK Java 7 TESTS 101 1480 67174400 2800
1910736 yarrr E July 19, 2012, 7:23 a.m. OK Java 7 TESTS 101 2110 77414400 2800
2475870 PlayLikeNeverB4 E Oct. 31, 2012, 11:06 p.m. OK Java 7 TESTS 101 2890 98406400 2800
1910082 yarrr E July 18, 2012, 9:41 p.m. OK Java 7 TESTS 101 2940 67174400 2800
1910731 yarrr E July 19, 2012, 7:21 a.m. OK Java 7 TESTS 101 2970 77414400 2800
31954007 tomdmitriev E Nov. 1, 2017, 2:48 p.m. OK Java 8 TESTS 101 1278 75878400 2800
23369766 Chapecoense E Dec. 28, 2016, 2:53 a.m. OK Java 8 TESTS 101 1590 116121600 2800
7144289 AlexFetisov E July 18, 2014, 3:49 a.m. OK Java 8 TESTS 101 2526 82329600 2800
3173428 seen E Feb. 22, 2013, 5:23 p.m. OK MS C++ TESTS 101 93 14745600 2800
1977975 Monyura E Aug. 5, 2012, 10:37 a.m. OK MS C++ TESTS 101 270 16486400 2800
1906185 FattyChicken E July 17, 2012, 8:22 a.m. OK MS C++ TESTS 101 310 38400000 2800
13194018 CleRIC E Sept. 23, 2015, 6:53 p.m. OK MS C++ TESTS 101 498 45875200 2800
1892756 Shef E July 11, 2012, 9:14 p.m. OK MS C++ TESTS 101 640 73932800 2800
4321347 kb. E Aug. 21, 2013, 7:14 p.m. OK MS C++ TESTS 101 654 112742400 2800
1909122 fcjy888 E July 18, 2012, 10:52 a.m. OK MS C++ TESTS 101 670 31948800 2800
1909109 fcjy888 E July 18, 2012, 10:45 a.m. OK MS C++ TESTS 101 720 59596800 2800
1896835 Kharybin E July 13, 2012, 8:46 a.m. OK MS C++ TESTS 101 750 15462400 2800
1909121 aa2985759 E July 18, 2012, 10:51 a.m. OK MS C++ TESTS 101 780 31948800 2800

remove filters

Back to search problems