Stepping NumbersProblem code: STEPNUMS |
All submissions for this problem are available.
Call a number stepping if adjacent digits, as well as the first and last digits, differ by one. How many n-digit base 11 stepping numbers are there? Give your answer modulo 4294967143.
For example, 8789A9 is a 6-digit base 11 stepping number. 9A0A and 234 are not stepping.
Input
The first line contains an integer T, the number of test cases (about 20000). Each of the next T lines contains an integer n (2 <= n < 264).
Output
Output the answer to each test case on a separate line.
Example
Input: 4 2 4 6 10 Output: 19 54 171 1958
| Author: | MichaelD |
| Date Added: | 4-07-2010 |
| Time Limit: | 1 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, ERL, 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

Fetching successful submissions

if a leading zero wud be
if a leading zero wud be permitted the number will be no longer of 2 digits... right??
is 01 is stepping number
is 01 is stepping number
Can you please add anything
Can you please add anything about leading zeros to statement?
y is the confusion getting
y is the confusion getting created test case for 2 shows that 01 is not included.. and 01 is not a 2 digit number also...
Give your answer modulo
Give your answer modulo 4294967143, means?
I have same question as Aim
I have same question as Aim Less. Please reply
@Aim Less and techrascal: You
@Aim Less and techrascal: You should give the remainder when the answer is divided by 4294967143.
@Aim Less and
@Aim Less and techrascal
http://en.wikipedia.org/wiki/Modular_arithmetic
@Aim Less and
@Aim Less and techrascal
http://en.wikipedia.org/wiki/Modular_arithmetic
[edited by admin] do not
[edited by admin] do not discuss test cases
[edited by admin] do not
[edited by admin] do not discuss test cases
@radhakrishnan No!
@radhakrishnan
No!
[edited by admin] do not
[edited by admin] do not discuss test cases
@admin : Sorry For discussing
@admin : Sorry For discussing test Cases
when coding i received the
when coding i received the warning when MOD IS SET TO THE GIVEN NUMBER 4294967143
k recitified
k recitified
The problem could be solved
The problem could be solved by a solution which is of a higher complexity than the official solution. This made it an "optimize as much as you can" challenge :)
guys..tell me how did you
guys..tell me how did you come up with such complex solution? Do you know the solution before hand? I am not asking about the programming part. I am asking about the formula...