TSHOW1 - Amusing numbers
Amusing numbers are numbers consisting only of digits 5 and 6. Given an integer k , display the k-th amusing number.
Input
FIrst line consists of integer N representing number of test cases
Next N lines consist of N integers (1 <= k <= 10^15)
Output
N lines each displaying corresponding k-th amusing number
Example
Input: 2 1 5 Output: 5 65
hide comments
abhinav vinci:
2015-08-18 18:27:35
good question ,feeling satisfied after thinking for days for it....() |
|
shantanu tripathi:
2015-08-17 06:04:49
nice one... fist attmpt AC :D |
|
atulshanbhag:
2015-08-15 18:34:15
simple stack question |
|
Aman Verma:
2015-08-08 11:27:30
@vasayashwanth Why are u posting spoiler, if you want to share some info please write a blog i would be more than happy to read than, may be give the link in comment but dont post comment that spoil the question |
|
Ankit:
2015-07-27 15:57:33
very easy :) |
|
vasayashwanth:
2015-07-11 10:12:15
just see the pattern 5,6,55,56,65,66,555,556,565,566,655.........and binary representation of numbers from 0 like 0,1,01,10,000,001,010,011,100............ |
|
SangKuan:
2015-07-01 13:38:16
i find two way to got ac. |
|
sam_29:
2015-06-23 21:39:43
nice one
|
|
sh:
2015-06-11 18:33:31
Initially used the logarithm method ,then realised that there is a simple +1 method. |
|
Parth:
2015-05-26 16:37:01
good!!
|
Added by: | Pandian |
Date: | 2012-04-10 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
Resource: | AOL code contest |