3 ms·
I'm not sure what you mean by "straightforward correct answer". I just used a big integer library, calculated the answer, and then took the first 10 digits. T
by btilly 17y ago
I'm not sure what you mean by "straightforward correct answer".
I just used a big integer library, calculated the answer, and then took the first 10 digits. That should work out fine in any reasonable general case that you're likely to be thinking of.
- extension 17y agoWhat I found in example solutions, and is indeed accepted by the site, is truncating each number to 10 digits and then summing. You can do this with just double-precision FP so it's likely to be the most common solution in languages that don't have bignums baked in.
- btilly 17y agoAh, right. There are also a number of problems where it is possible to narrow down the answer fairly easily, then submit a limited number of guesses until you get the right answer without having really shown that it is right. But they try to limit how easy that is to do.
- roundsquare 17y agoThere are also a number of problems where it is possible to narrow down the answer fairly easily, then submit a limited number of guesses until you get the right answer without having really shown that it is right. To some degree, they need to rely on the users to care enough not to "cheat." There is no way to completely avoid people doing things like this.