SMRTR - Are You Smarter than a fifth Grader
The Problem is to find are you smarter than a fifth grader or not. You will be given some number between 0 to 9 inclusive. You have to find the maximum and minimum number of nth digit can be generated with the numbers. Believe me or not the problem is taken from the math book of class six.
Input and Output
The input file contains several test cases. Each case contains a Number N(1<=N<=5000). [You have to take input untill end of file....] Next line contains N digits between 0 to 9 inclusive separated by one or more spaces. You can assume that at least one non zero number will exists in the input.
Print the maximum number and minimum number of Nth digits they made in two lines. See Sample input output for Exact format (there is no blank line between two lines of the problems in sample).
Example
Sample Input
5
1 3 2 5 4
Sample Output
54321
12345
hide comments
|
Bhavik:
2014-03-15 05:29:32
@francky: though it is just a suggestion try submitting your code in c/C++ with same logic where there is no such input problems...if it gets AC then you can prove that there is some problem with input... |
|
Francky:
2014-03-15 05:29:32
Are all digits on a unique second line ? If no input should be reformatted. I think I handle all cases... but WA.
|
|
Bhavik:
2014-03-15 05:29:32
all the solutions are now WA!! as far as input is concerned it asks us tor read till EOF so i think there is no problem with that
|
|
Kazi Sadlil Rhythm:
2014-03-15 05:29:32
There was a glich in the data set.. So some wrong solution got Accpted... Now the problem is fixed and all the problem rejuged......... Sorry For my wrong data set.......
|
|
Kazi Sadlil Rhythm:
2014-03-15 05:29:32
Problem Updated.... @Francky
|
|
Francky:
2014-03-15 05:29:32
Obviously a tutorial task. Moreover no need to restrict language. @pstetter : please reduce input file, if need, so that slow language can get AC. Bad complexity with fast language will have TLE in any case. You have to allow all languages. Problem hidden waiting for that.
|
|
Bhavik:
2014-03-15 05:29:32
no need for fast i/o to get accepted..
|
|
sharad mahajan:
2014-03-15 05:29:32
easy one
|
Added by: | Kazi Sadlil Rhythm |
Date: | 2014-02-16 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |