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
You have a dictionary, which is a list of distinct words sorted in alphabetical order. Each word consists of uppercase English letters. You want to print this dictionary. However, there is a bug with the printing system, and all words in the list are printed next to each other without any separators between words. Now, you ended up with a string (S) that is a concatenation of all the words in the dictionary in the listed order. Your task is to reconstruct the dictionary by splitting (S) into one or more words. Note that the reconstructed dictionary must consist of distinct words sorted in alphabetical order. Furthermore, you want to maximize the number of words in the dictionary. If there are several possible dictionaries with the maximum number of words, you can choose any of them. A single line consisting of a string (S) ((1 \leq |S| \leq 5000)). String (S) consists of only uppercase English letters. First, output an integer in a single line representing the maximum number of the words in the reconstructed dictionary. Denote this number as (n). Then, output (n) lines, each containing a single string representing the word. The words must be distinct, and the list must be sorted alphabetically. The concatenation of the words in the listed order must equal (S). If there are several possible dictionaries with the maximum number of words, output any of them. |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
294214461 |
Atekichan sv1shan _helloLad |
H |
Dec. 1, 2024, 2:19 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
101 |
234 |
100761600 |
|
2200 |
|
294233963 |
s0s19999 |
H |
Dec. 1, 2024, 4:30 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
101 |
312 |
300851200 |
|
2200 |
|
294156959 |
hieu_2004 |
H |
Dec. 1, 2024, 7:42 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
101 |
312 |
401612800 |
|
2200 |
|
294158701 |
Warma_Cute |
H |
Dec. 1, 2024, 7:57 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
101 |
327 |
302080000 |
|
2200 |
|
294153191 |
LiuXingJian little_vegetable |
H |
Dec. 1, 2024, 7:07 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
101 |
358 |
301260800 |
|
2200 |
|
294159151 |
hata_saa lenhanboofficial Swishy123 |
H |
Dec. 1, 2024, 8:01 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
101 |
359 |
401612800 |
|
2200 |
|
294196904 |
chenyewei_1234 |
H |
Dec. 1, 2024, 12:33 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
101 |
405 |
301977600 |
|
2200 |
|
294154868 |
Mingyu331 mjhmjh1104 as_dfsdf |
H |
Dec. 1, 2024, 7:22 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
101 |
406 |
200908800 |
|
2200 |
|
294226286 |
magnified HollwoQ_Pelw TrungNotChung |
H |
Dec. 1, 2024, 3:35 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
101 |
406 |
306688000 |
|
2200 |
|
294279494 |
joelgun14 |
H |
Dec. 1, 2024, 11:27 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
101 |
421 |
286617600 |
|
2200 |
|
294157689 |
syx2567 songhongyi dongyc666 |
H |
Dec. 1, 2024, 7:48 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
101 |
202 |
301465600 |
|
2200 |
|
294160031 |
turkhuu622 |
H |
Dec. 1, 2024, 8:09 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
101 |
249 |
301260800 |
|
2200 |
|
294157624 |
TKT_YI |
H |
Dec. 1, 2024, 7:47 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
101 |
389 |
197222400 |
|
2200 |
|
294158245 |
nh_nayeem Alfeh Ryuga_ |
H |
Dec. 1, 2024, 7:53 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
101 |
390 |
200601600 |
|
2200 |
|
294153080 |
xcyyyyyy lhzawa |
H |
Dec. 1, 2024, 7:06 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
101 |
405 |
301875200 |
|
2200 |
|
294139331 |
DELTARUNE kizen qwerasdfzxcl |
H |
Dec. 1, 2024, 5:32 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
101 |
406 |
408883200 |
|
2200 |
|
294153021 |
arnold518 YeongTree Karuna |
H |
Dec. 1, 2024, 7:06 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
101 |
421 |
301875200 |
|
2200 |
|
294170873 |
_ChiFAN_ |
H |
Dec. 1, 2024, 9:45 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
101 |
421 |
733798400 |
|
2200 |
|
294229875 |
cry |
H |
Dec. 1, 2024, 4 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
101 |
437 |
398131200 |
|
2200 |
|
294151759 |
Zeyush Marco_L_T stan23456 |
H |
Dec. 1, 2024, 6:54 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
101 |
452 |
205414400 |
|
2200 |
|
294156211 |
AC_sahER lemelisk |
H |
Dec. 1, 2024, 7:35 a.m. |
OK |
C++23 (GCC 14-64, msys2) |
TESTS |
101 |
327 |
150425600 |
|
2200 |
|
294161964 |
shstyle jiangzhihui Lavine |
H |
Dec. 1, 2024, 8:27 a.m. |
OK |
C++23 (GCC 14-64, msys2) |
TESTS |
101 |
343 |
248320000 |
|
2200 |
|
294289374 |
yvbf |
H |
Dec. 2, 2024, 3:30 a.m. |
OK |
C++23 (GCC 14-64, msys2) |
TESTS |
101 |
390 |
297779200 |
|
2200 |
|
294157667 |
d_k_d |
H |
Dec. 1, 2024, 7:48 a.m. |
OK |
C++23 (GCC 14-64, msys2) |
TESTS |
101 |
405 |
197734400 |
|
2200 |
|
294173572 |
Mrcharlezzz Giga_Cronos |
H |
Dec. 1, 2024, 9:50 a.m. |
OK |
C++23 (GCC 14-64, msys2) |
TESTS |
101 |
405 |
602931200 |
|
2200 |
|
294145174 |
Savior-of-Cross |
H |
Dec. 1, 2024, 6:28 a.m. |
OK |
C++23 (GCC 14-64, msys2) |
TESTS |
101 |
421 |
197632000 |
|
2200 |
|
294155700 |
bkdn24.Ravenous bkdn24.lnba bkdn24.leevox |
H |
Dec. 1, 2024, 7:30 a.m. |
OK |
C++23 (GCC 14-64, msys2) |
TESTS |
101 |
421 |
502067200 |
|
2200 |
|
294142035 |
neal |
H |
Dec. 1, 2024, 5:58 a.m. |
OK |
C++23 (GCC 14-64, msys2) |
TESTS |
101 |
437 |
97177600 |
|
2200 |
|
294169847 |
lotusblume asdasdqwer paultristanwagner |
H |
Dec. 1, 2024, 9:36 a.m. |
OK |
C++23 (GCC 14-64, msys2) |
TESTS |
101 |
437 |
297984000 |
|
2200 |
|
294153143 |
greatpaul2008 |
H |
Dec. 1, 2024, 7:07 a.m. |
OK |
C++23 (GCC 14-64, msys2) |
TESTS |
101 |
452 |
301670400 |
|
2200 |
|
294252660 |
__baozii__ |
H |
Dec. 1, 2024, 6:48 p.m. |
OK |
Go |
TESTS |
101 |
499 |
311296000 |
|
2200 |
remove filters
Back to search problems