DCP-207: Mina and Raju Part 2 Back to All Problems

Hard String > Minimum Expression


Mina and Raju playing with string. Raju gives Mina a string S of length L. Mina can rotate the string from left to right. String turns like a circular sequence. Mina’s task is to find the lexicographically smallest sequence from a given string. For example if the given string is ‘alabala’ then the lexicographically smallest string is aalabal. alabala -> labalaa -> abalaal -> balaala -> alaalab -> laalaba -> aalabal Input: ------ The first line contains an integer T( 1<= T <= 100 ) which denotes the number of Test cases. T test cases follow . Each test case contains a string S of length L. Output: ------- For each test case, print a line “Case x: y” where x is replaced by the test case number and y is the lexicographical smallest string. Constraints: -------------- 1 <= T <= 100 1 <= L <= 50000 Sample Input ------------ 2 cgagtcagct ctcc Sample Output ------------- Case 1: agctcgagtc Case 2: ccct


Problem Setter:

Shakil Ahmed

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 0.75
C++ 0.75
C++14 0.75
C# 1.50
Go 1.50
Java 1.50
JavaScript 1.50
Objective-C 1.50
Perl 1.50
PHP 1.50
Python 1.50
Python3 1.50
Ruby 1.50
VB.Net 1.50

Problem Stats

69/207

Solve/Submission

Ranking

# User Language Timing
01 tariqiitju Cpp14 0.01s
02 feodorv C 0.01s
03 Morass Cpp14 0.01s
04 twyu0721 Cpp 0.01s
05 SakibAlamin Cpp14 0.02s
06 anowar1112 Cpp14 0.02s
07 alhelal_cse Cpp14 0.02s
08 akazad_cse13_ruet Cpp14 0.03s
09 ssavi Cpp14 0.03s
10 abinash Cpp14 0.03s
11 mamun4122 Cpp14 0.04s
12 CLown1331 Cpp14 0.05s
13 dip_BRUR Cpp14 0.05s
14 _dipu Cpp14 0.05s
15 Baka_Raffi Cpp 0.06s
16 Robbinb1993 Cpp 0.07s
17 MazedRupok Cpp14 0.07s
18 ksohan Cpp14 0.07s
19 saurabh3240 Cpp14 0.07s
20 rayhan50001 Cpp14 0.08s
21 darkprinx Cpp14 0.09s
22 nasif2587 Cpp14 0.09s
23 as_couple Cpp14 0.09s
24 Masum_ice Cpp14 0.09s
25 Knight_King Cpp14 0.10s
26 emrul Cpp14 0.10s
27 sayedgkm Cpp14 0.12s
28 Rajan_sust Cpp14 0.17s
29 rafiul41 Cpp14 0.21s
30 nihillian Cpp 0.22s
31 anikatahsin Cpp14 0.29s
32 Pure_Protea Cpp14 0.29s
33 PKP_007 Cpp14 0.30s
34 Taran Cpp14 0.31s
35 Zeronfinity Cpp14 0.33s
36 sazal_dev Cpp14 0.34s
37 seyedssz Cpp14 0.36s
38 rafsan_rana Cpp14 0.38s
39 ToErr Cpp14 0.52s
40 aseem_cu Cpp14 0.55s
41 Gang_Of_Three_01 Cpp14 0.56s
42 EWU_FatimaTasnim Cpp14 0.59s
43 Jisancse Cpp14 0.64s
44 fsshakkhor Cpp14 0.65s
45 moshiur_cse15 Cpp14 0.66s
46 skmonir Cpp14 0.69s
47 sahedsohel Cpp14 0.71s
48 chowdhury Cpp14 0.74s
49 sangshaptac Cpp14 0.75s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support