Https:// (DOR)

can anyone tell me what is wrong in my code
I am following the approach given in the editoial

Here’s a test case:

393383587145601330 571238254289132474

The answer should be:


but your code produces:


Off by 1 digit.


Line 45

How about changing that to ans += 1LLU << i;?
If you refer to this, you’ll know that pow is simply not enough for dealing with such large numbers.

1 Like

ok thanks
my solution got accepted after I multiplied 2 repeatedly in for loop rather than using pow function

1 Like