kingofpineapples's blog

By kingofpineapples, history, 3 years ago, In English

I'm reading through Competitive Programming 3, and the book recommends that you learn java on top of c++ to use biginteger. I don't know any java, so I don't know if it is worth it to learn just to use biginteger. I've never encountered a problem outside of the uva problem set that would be greatly simplified with biginteger, so I was wondering if any more experienced programmers could give some input. Thanks!

  • Vote: I like it
  • +14
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it +81 Vote: I do not like it

Big integers are very rarely needed in competitive programming. In fact, I don't remember any problem that requires big integers. Instead, you should print the answer modulo some number.

If I needed big integers, I would use Python instead of Java. The syntax of Java's BigInteger class is horrible.

»
3 years ago, # |
  Vote: I like it +6 Vote: I do not like it

You can just copy someone else's big integer template.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it