1 / 3
Oct 2019

Hello,

I don’t think there’s any issue with your code. However, my best guess is that this issue requires big number arithmetic so even uint64_t is not big enough.

I’d be surprised if a “basics” problem required the use of big numbers, particularly without mentioning it in the description or constraints.

I think the much more likely explanation is that the test data is faulty in some way. It’s unfortunate, but this author has a history of adding problems with bad test data.