DHere is the code :
REMOVED*
hOne obvious bug is %ld for n( long long)
It must be %lld
dwell here is mistake ...
rez = k*l1/l2
it has to be
rez = int( k*l1/double(l2) );
try now ...
di am not sure why it doesn't work ...
when i submited with log(n) / log(10) it fails on 4th test case, but when i submited with log10(n) it passed all tests cases ...
i am not sure why, because: logc N = logk ( N ) / logk (c) ...
so log10(N) = log(N) / log(10) ...
DYou submitted code like this ?
REMOVED*
this doesn't work for me ...
DIt works thanks, but I still don't understand what was wrong ? :D
gprobably some precision error.
RAt the 4-th test case n is a power of ten so for that n^k is a power of ten, meaning that the base 10 logarithm is an integer, so you can easily get an error.
In my solution I'm treat the n=10^e as a special case.
dYou are absolutelyright!!!
Any explanation though?