Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.
Problem hidden on 2014-03-14 19:11:21 by Francky

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


Added by:Kazi Sadlil Rhythm
Date:2014-02-16
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All

hide comments
2014-03-15 05:29:32 Francky
I very well know how to deal it with Python, but I think at beginner user in Python. As input still contains wrong formatting ; problem is hidden waiting for fix and rejudge.

--ans(eror)--> i don't know where is the wrong formatting.. i used an ICPC standerd format called "end of file". and the I/O file are correct for that. Some got AC. I dont know how to deal it with python... If You want me to split up the test cases into several file.. I can do it. But it will take time. Thts why i restrict some languages.. By the way thank you... I will try my best to fixed the problem...

--ans(Franck)--> I ever told you not to restrict language, but rather give a proper input file ended with '\n', or give at start the number of test case (it's even better).

--ans(eror)--> will do franck. after some time i will update this problem...

Last edit: 2014-03-18 20:16:02
2014-03-15 05:29:32 Kazi Sadlil Rhythm
Every one is suggested to code with cin or scanf() in c++/c.... Scanner.nextInt() in java...

Tips: For End of file Try This syntex
c : while(scanf("%ld",&n)==1)
c++ : while(cin>>n)
java : while(input.hasNext())
2014-03-15 05:29:32 anurag garg
AC finally,,,,wrong input caused me 3 TLE
strong test cases

Last edit: 2014-03-14 18:46:44
2014-03-15 05:29:32 Francky
I ask you, please, to put a '\n' in last line, it cause troubles in some language. Problem will be hidden if not. Thanks for your comprehension. Or you can start the file with the number of test case.

--ans(eror)--> '\n' added in the last line..


Last edit: 2014-03-14 18:52:01
2014-03-15 05:29:32 Bhavik
@Mitch: according to my ac solution
1)102
2)there is no such case
3)N=2
0 0
o/p:
00
00
2014-03-15 05:29:32 Francky
@Mitch:
1) I think leading 0 is not allowed unless for 0 itself. So for your case, I thought about 102.
2) I assumed it wasn't in input as it is undefined.
3) I handle that case. -> 0 0
... ???

Last edit: 2014-03-14 18:34:51
2014-03-15 05:29:32 Mitch Schwartz
The problem is not clear on several points:

1) whether leading zeroes are allowed in output. E.g.: min number for digits "0 1 2" should be "012" or "12" or "102" ?
2) what to do when N=0
3) what to do if N>1 and all digits are 0.

--ans(eror)--> every question is answered in the problem statement....

(Mitch) The sentence "You can assume that at least one non zero number will exists in the input" was not there before, and you changed "0<=N<=5000" to "1<=N<=5000". You answered in a way that doesn't acknowledge that fact, making it look like I made a reading error, which is not very nice. Moreover, I think the leading zeroes issue could still be stated clearly rather than just implied, as it is now. @Francky and @Bhakiv: Thanks for answers. I wrote it as advice for the problem setter for writing clear problem statements.

--ans(eror) @Mitch sorry, i mistakenly uploaded the wrong statment first and when noticed then fixed it.. sorry for my inconvinence. as it is my first problem i hope u all will forgive me some little mistakes...


Last edit: 2014-03-18 20:19:30
2014-03-15 05:29:32 Francky
Is the last line feed with a '\n': if no it can explain my NZEC. If you take a look at 99% of spoj problem you'll see that input begins by number of test case. Please feed the last line if need.

--ans(eror)--> ther are several test case in one file.. and ther is no '\n' in the last line..
the input file may looks like
-----start-----
5
1 2 3 4 5
4
1 2 3 4
-------end------

--ans(Francky)--> Your sample seems to be false. 4 announced and 3 given...

Last edit: 2014-03-18 20:16:38
2014-03-15 05:29:32 Bhavik
there will be multiple cases per file and each case has two lines:1st line N and next line has N space separated integers from 0-9.For each case print two lines having max and minimum possible number....

Last edit: 2014-03-14 18:18:32
2014-03-15 05:29:32 Francky
There are several case per file exact ? I didn't saw that before. Usually the number of test cases is given at start. My new code gave NZEC because the number of digits didn't correspond to that announced (and I ask for 1/0). Please explain.

--ans(eror)--> the number of digits is correct.. I checked it... I don't know why u are getting RE.

Last edit: 2014-03-14 18:19:56
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.