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.
Problems
B'A substring of some string is called the most frequent, if the number of its occurrences is not less than number of occurrences of any other substring. You are given a set of strings. A string (not necessarily from this set) is called good if all elements of the set are the most frequent substrings of this string. Restore the non-empty good string with minimum length. If several such strings exist, restore lexicographically minimum string. If there are no good strings, print "NO" (without quotes). A substring of a string is a contiguous subsequence of letters in the string. For example, "ab", "c", "abc" are substrings of string "abc", while "ac" is not a substring of that string. The number of occurrences of a substring in a string is the number of starting positions in the string where the substring occurs. These occurrences could overlap. String a is lexicographically smaller than string b, if a is a prefix of b, or a has a smaller letter at the first position where a and b differ. The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of strings in the set. Each of the next n lines contains a non-empty string consisting of lowercase English letters. It is guaranteed that the strings are distinct. The total length of the strings doesn 't exceed 105. Print the non-empty good string with minimum length. If several good strings exist, print lexicographically minimum among them. Print "NO" (without quotes) if there are no good strings. One can show that in the first sample only two good strings with minimum length exist: "cfmailru" and "mailrucf". The first string is lexicographically minimum. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
32495878 |
asaveljevs |
D |
Nov. 20, 2017, 10:26 a.m. |
OK |
GNU C++ |
TESTS |
47 |
15 |
0 |
|
2000 |
32321747 |
CarrieM7 |
D |
Nov. 14, 2017, 11:53 p.m. |
OK |
GNU C++ |
TESTS |
47 |
15 |
0 |
|
2000 |
32531603 |
AgReB |
D |
Nov. 21, 2017, 5:01 p.m. |
OK |
GNU C++ |
TESTS |
47 |
15 |
204800 |
|
2000 |
32347765 |
Tconan |
D |
Nov. 16, 2017, 5:41 a.m. |
OK |
GNU C++ |
TESTS |
47 |
15 |
307200 |
|
2000 |
32347748 |
Tconan |
D |
Nov. 16, 2017, 5:40 a.m. |
OK |
GNU C++ |
TESTS |
47 |
15 |
307200 |
|
2000 |
32644307 |
daniellim |
D |
Nov. 25, 2017, 10:41 a.m. |
OK |
GNU C++ |
TESTS |
47 |
15 |
1945600 |
|
2000 |
34413433 |
poorpool |
D |
Jan. 21, 2018, 12:25 p.m. |
OK |
GNU C++ |
TESTS |
47 |
15 |
2048000 |
|
2000 |
32360558 |
moldot |
D |
Nov. 16, 2017, 4:34 p.m. |
OK |
GNU C++ |
TESTS |
47 |
15 |
3276800 |
|
2000 |
32319488 |
misha_sh |
D |
Nov. 14, 2017, 8:03 p.m. |
OK |
GNU C++ |
TESTS |
47 |
30 |
0 |
|
2000 |
32308188 |
SGH |
D |
Nov. 14, 2017, 10:05 a.m. |
OK |
GNU C++ |
TESTS |
47 |
30 |
0 |
|
2000 |
32538943 |
Jiburiru |
D |
Nov. 22, 2017, 2:52 a.m. |
OK |
GNU C++11 |
TESTS |
47 |
15 |
0 |
|
2000 |
32345198 |
xyzzxy |
D |
Nov. 16, 2017, 3:24 a.m. |
OK |
GNU C++11 |
TESTS |
47 |
15 |
0 |
|
2000 |
32326591 |
kurs |
D |
Nov. 15, 2017, 7:44 a.m. |
OK |
GNU C++11 |
TESTS |
47 |
15 |
0 |
|
2000 |
32291292 |
infomaniac |
D |
Nov. 13, 2017, 5:56 p.m. |
OK |
GNU C++11 |
TESTS |
47 |
15 |
0 |
|
2000 |
32281940 |
TadijaSebez |
D |
Nov. 13, 2017, 11:03 a.m. |
OK |
GNU C++11 |
TESTS |
47 |
15 |
0 |
|
2000 |
32280692 |
SkyXH |
D |
Nov. 13, 2017, 9:47 a.m. |
OK |
GNU C++11 |
TESTS |
47 |
15 |
0 |
|
2000 |
32273759 |
Jonno |
D |
Nov. 12, 2017, 11:55 p.m. |
OK |
GNU C++11 |
TESTS |
47 |
15 |
0 |
|
2000 |
32270377 |
LadyPython |
D |
Nov. 12, 2017, 6:34 p.m. |
OK |
GNU C++11 |
TESTS |
47 |
15 |
0 |
|
2000 |
32267330 |
MCDavidas |
D |
Nov. 12, 2017, 6:01 p.m. |
OK |
GNU C++11 |
TESTS |
47 |
15 |
0 |
|
2000 |
32316866 |
vjudge4 |
D |
Nov. 14, 2017, 4:46 p.m. |
OK |
GNU C++11 |
TESTS |
47 |
15 |
102400 |
|
2000 |
32362182 |
_LV_SKLNSK_MRN |
D |
Nov. 16, 2017, 5:50 p.m. |
OK |
GNU C++14 |
TESTS |
47 |
15 |
0 |
|
2000 |
32349288 |
Alexxx |
D |
Nov. 16, 2017, 7:31 a.m. |
OK |
GNU C++14 |
TESTS |
47 |
15 |
0 |
|
2000 |
32304459 |
I_love_myself |
D |
Nov. 14, 2017, 6:24 a.m. |
OK |
GNU C++14 |
TESTS |
47 |
15 |
0 |
|
2000 |
32288972 |
vladKB1 |
D |
Nov. 13, 2017, 4:07 p.m. |
OK |
GNU C++14 |
TESTS |
47 |
15 |
0 |
|
2000 |
32281618 |
sedrick |
D |
Nov. 13, 2017, 10:46 a.m. |
OK |
GNU C++14 |
TESTS |
47 |
15 |
0 |
|
2000 |
32279984 |
IgorI |
D |
Nov. 13, 2017, 8:59 a.m. |
OK |
GNU C++14 |
TESTS |
47 |
15 |
0 |
|
2000 |
32279941 |
alexX512 |
D |
Nov. 13, 2017, 8:57 a.m. |
OK |
GNU C++14 |
TESTS |
47 |
15 |
0 |
|
2000 |
32269800 |
NuradilK |
D |
Nov. 12, 2017, 6:28 p.m. |
OK |
GNU C++14 |
TESTS |
47 |
15 |
0 |
|
2000 |
32268487 |
MikhailovBair |
D |
Nov. 12, 2017, 6:14 p.m. |
OK |
GNU C++14 |
TESTS |
47 |
15 |
0 |
|
2000 |
32268402 |
Akihiko_Kayaba |
D |
Nov. 12, 2017, 6:13 p.m. |
OK |
GNU C++14 |
TESTS |
47 |
15 |
0 |
|
2000 |
55698400 |
chongryong |
D |
June 18, 2019, 1:42 a.m. |
OK |
GNU C++17 |
TESTS |
47 |
15 |
102400 |
|
2000 |
54393586 |
singhrahul15114024 |
D |
May 19, 2019, 6:09 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
15 |
204800 |
|
2000 |
60029784 |
Semenar |
D |
Sept. 4, 2019, 3:05 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
15 |
819200 |
|
2000 |
63075776 |
dibyadarshan |
D |
Oct. 21, 2019, 1:39 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
30 |
0 |
|
2000 |
39358506 |
YazanRi |
D |
June 18, 2018, 2:34 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
30 |
0 |
|
2000 |
68127657 |
Phortox |
D |
Jan. 3, 2020, 3:48 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
31 |
0 |
|
2000 |
64459891 |
jakob_nogler |
D |
Nov. 7, 2019, 9:58 a.m. |
OK |
GNU C++17 |
TESTS |
47 |
31 |
0 |
|
2000 |
56423119 |
KasugaAyumu |
D |
July 2, 2019, 8:19 a.m. |
OK |
GNU C++17 |
TESTS |
47 |
31 |
0 |
|
2000 |
63752835 |
KonaeAkira |
D |
Oct. 29, 2019, 9:14 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
31 |
102400 |
|
2000 |
61349676 |
bluefi |
D |
Sept. 27, 2019, 7:20 a.m. |
OK |
GNU C++17 |
TESTS |
47 |
31 |
102400 |
|
2000 |
32419454 |
Zamora |
D |
Nov. 18, 2017, 3:42 a.m. |
OK |
Java 8 |
TESTS |
47 |
124 |
0 |
|
2000 |
32419356 |
4mda4mda |
D |
Nov. 18, 2017, 3:35 a.m. |
OK |
Java 8 |
TESTS |
47 |
124 |
0 |
|
2000 |
32419126 |
4mda4mda |
D |
Nov. 18, 2017, 3:16 a.m. |
OK |
Java 8 |
TESTS |
47 |
124 |
0 |
|
2000 |
32290740 |
Lear |
D |
Nov. 13, 2017, 5:27 p.m. |
OK |
Java 8 |
TESTS |
47 |
124 |
0 |
|
2000 |
33883243 |
tmwilliamlin168 |
D |
Jan. 3, 2018, 11:08 a.m. |
OK |
Java 8 |
TESTS |
47 |
124 |
20787200 |
|
2000 |
32350046 |
habanera |
D |
Nov. 16, 2017, 8:17 a.m. |
OK |
Java 8 |
TESTS |
47 |
139 |
0 |
|
2000 |
32316835 |
Jeel_Vaishnav |
D |
Nov. 14, 2017, 4:44 p.m. |
OK |
Java 8 |
TESTS |
47 |
140 |
0 |
|
2000 |
35739342 |
alibaba |
D |
Feb. 26, 2018, 4:57 p.m. |
OK |
Java 8 |
TESTS |
47 |
140 |
20684800 |
|
2000 |
32284598 |
993035197 |
D |
Nov. 13, 2017, 12:58 p.m. |
OK |
Java 8 |
TESTS |
47 |
155 |
0 |
|
2000 |
32283007 |
SharpBlade |
D |
Nov. 13, 2017, 11:52 a.m. |
OK |
JavaScript |
TESTS |
47 |
31 |
1638400 |
|
2000 |
32287894 |
almogwald |
D |
Nov. 13, 2017, 3:18 p.m. |
OK |
MS C++ |
TESTS |
47 |
15 |
0 |
|
2000 |
32271118 |
egardoz01 |
D |
Nov. 12, 2017, 7:47 p.m. |
OK |
MS C++ |
TESTS |
47 |
15 |
0 |
|
2000 |
32269387 |
Timonnable |
D |
Nov. 12, 2017, 6:24 p.m. |
OK |
MS C++ |
TESTS |
47 |
15 |
0 |
|
2000 |
32267659 |
Capitan |
D |
Nov. 12, 2017, 6:04 p.m. |
OK |
MS C++ |
TESTS |
47 |
15 |
0 |
|
2000 |
32310034 |
Maffka |
D |
Nov. 14, 2017, 11:44 a.m. |
OK |
MS C++ |
TESTS |
47 |
15 |
3072000 |
|
2000 |
32376989 |
Yroslav |
D |
Nov. 17, 2017, 11:54 a.m. |
OK |
MS C++ |
TESTS |
47 |
30 |
102400 |
|
2000 |
38919813 |
scorpiowf |
D |
June 3, 2018, 11:55 a.m. |
OK |
MS C++ |
TESTS |
47 |
31 |
3584000 |
|
2000 |
64888028 |
DarisHS |
D |
Nov. 14, 2019, 1:44 p.m. |
OK |
MS C++ 2017 |
TESTS |
47 |
31 |
1024000 |
|
2000 |
32287212 |
Akulyat |
D |
Nov. 13, 2017, 2:44 p.m. |
OK |
PascalABC.NET |
TESTS |
47 |
46 |
2867200 |
|
2000 |
32362405 |
mayakin |
D |
Nov. 16, 2017, 6:01 p.m. |
OK |
PHP |
TESTS |
47 |
93 |
512000 |
|
2000 |
32336961 |
tushutripathi |
D |
Nov. 15, 2017, 4:10 p.m. |
OK |
PyPy 2 |
TESTS |
47 |
218 |
8908800 |
|
2000 |
32337807 |
tushutripathi |
D |
Nov. 15, 2017, 4:45 p.m. |
OK |
PyPy 2 |
TESTS |
47 |
249 |
8908800 |
|
2000 |
39438916 |
yugle7 |
D |
June 20, 2018, 2:44 p.m. |
OK |
PyPy 3 |
TESTS |
47 |
139 |
102400 |
|
2000 |
42246671 |
ulyabelyaeva |
D |
Aug. 29, 2018, 3:42 p.m. |
OK |
PyPy 3 |
TESTS |
47 |
249 |
4915200 |
|
2000 |
32577433 |
Marble17 |
D |
Nov. 23, 2017, 2:08 p.m. |
OK |
Python 3 |
TESTS |
47 |
62 |
4812800 |
|
2000 |
32271197 |
plop |
D |
Nov. 12, 2017, 7:59 p.m. |
OK |
Python 3 |
TESTS |
47 |
77 |
0 |
|
2000 |
32329831 |
steckel |
D |
Nov. 15, 2017, 11:23 a.m. |
OK |
Python 3 |
TESTS |
47 |
77 |
4915200 |
|
2000 |
39439026 |
yugle7 |
D |
June 20, 2018, 2:49 p.m. |
OK |
Python 3 |
TESTS |
47 |
78 |
0 |
|
2000 |
32785854 |
Marble1 |
D |
Nov. 29, 2017, 4:30 p.m. |
OK |
Python 3 |
TESTS |
47 |
93 |
10444800 |
|
2000 |
67183871 |
NocturneBflat |
D |
Dec. 19, 2019, 2:51 a.m. |
OK |
Python 3 |
TESTS |
47 |
171 |
307200 |
|
2000 |
32434296 |
cwsang |
D |
Nov. 18, 2017, 2:46 p.m. |
OK |
Python 3 |
TESTS |
47 |
1591 |
5632000 |
|
2000 |
remove filters
Back to search problems