CodeChef: Practical coding for everyone this is my code
And what about
1
10 10
Your code prints
1000000000 0000000000
but correct output is
1000000000 1000000000
Just change the data type from double to long double and use log10l()
for better precision in the firstkdigit() function.
Here is the corrected code.
Edit:
@jaythegenius
Here is the corrected code,
You had to use long long datatype for the arguments and operations in the LastKDigitsModularExponetiation() function.
You are correct this input is not valid.
@jaskaran_1 … there is an error of 1 in your ans…
for 8 8 your’s showing…
16777215 16777216
and mine
16777216 16777216
do check this
@deepankarak I used long double and log10l() for my approach
Still getting WA at 0.64 here is my solution
enHGS8 - Online C++ Compiler & Debugging Tool - Ideone.com …Thanx in advance
jay see input #3…!!!
typecast using long long instead of int!!!
Thanks @deepankarak.What is log10l?