plz help why my code given wrong answer,???
using namespace std;
unsigned long long n,k,ans;
you are not taking modulo at any step. This is one of the mistake
but test case given right answer,
plz help i can’t understand i can i use that in this case
for n=0. this won’t work.
Which test case, the sample? Of course modulo wouldn’t affect that, the answers are nowhere near 1 billion.
Here’s a case you’ll fail on:
Also, format your code or link the submission, because it’s literally impossible for us to debug it otherwise.
Ok but for large number like n = 10^9 and k = 10^9 it would result in very large number and integer overflow so what you need is do modulo m which will be given in question.
see this CodeChef: Practical coding for everyone