LEXISORT - Easy Sorting
Given is a list of words and a lexicographical ordering according to the ascii alphabet. Your task is to sort the words in increasing order.
The first line contains the numbers of test cases k (k< 100). Every test case consists of n+1 (1 < n < 50000) lines. Each line contains of a string of 10 characters. The first line of each test case contains n.
Output the sorted list of words.
Input: 2 2 helloworld worldhello 2 aaaaaaaaaa Aaaaaaaaaa Output: helloworld worldhello Aaaaaaaaaa aaaaaaaaaa
"My code is great, it's the computer that's wrong." -- says the guy missing the good old days of SPOJ, which would be a month ago, when he began using it.
java gives tle or wrong answer . i sorted vector in c++ and worked somehow.Quality of spoj is so poor now a days.
La Van Tien:
oops!Last edit: 2017-04-01 19:14:41
sort over string vector works too 0.03s
And improved implementation of radix sort through structures gave 0.01s . Still waiting for 0.00s ...Last edit: 2015-05-30 02:09:14
i am getting WA, i have checked it on hundreds of different cases on ideone, but no idea
poor documentation of problem. what is n and c.
STL MAP :D
Quick Sort is enough for this problem.
you can use quick sort.
|Cluster:||Cube (Intel G860)|
|Languages:||All except: NODEJS PERL6 VB.NET|