Not that DigitProblem code: NSIT15 |
All submissions for this problem are available.
Majin wants to label his N (1 <= N <= 1,000,000) towers. He has lost the labels with the digit L (0 <= L <= 9) written on them. Assume he has sufficient labels to complete the task.
If the towers are labeled with the smallest set of N positive integers that don't have the digit L, what is the largest number that Majin will label the tower as ?
Input
The first line has an integer 't' (1<=t<=10), the number of test cases. t cases follow.
Each test case containse two space-separated integers on a single line: N and L
Output
A single integer that is the largest number a tower can have.
Example
Input: 1 10 0 Output: 11 Explanation The smallest 10 numbers he can use are: 1, 2, 3, 4, 5, 6, 7, 8, 9, and 11.
| Author: | admin |
| Date Added: | 8-10-2009 |
| Time Limit: | 3 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC |
Comments
SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:
HELP
Program should read from standard input and write to standard output. After you submit a solution you can see your results by clicking on the [My Submissions] tab on the problem page. Below are the possible results:
- Accepted
Your program ran successfully and gave a correct answer. If there is a score for the problem, this will be displayed in parenthesis next to the checkmark. - Time Limit Exceeded
Your program was compiled successfully, but it didn't stop before time limit. Try optimizing your approach. - Wrong Answer
Your program compiled and ran succesfully but the output did not match the expected output. - Runtime Error
Your code compiled and ran but encountered an error. The most common reasons are using too much memory or dividing by zero. For the specific error codes see the help section. - Compilation Error
Your code was unable to compile. When you see this icon, click on it for more information.
If you are still having problems, see a sample solution here.

Fetching successful submissions

well... i just can't seem to
well... i just can't seem to figure out what's wrong with my prog...
it gives the correct output when i try on my system ( i checked using brute force ) but the system says my output is wrong :(
Admin, please have a look at it...
thanks...
can we label the tower with
no..
ths problem shd be under the
@raman92-post your