Pl4gue's blog

By Pl4gue, history, 7 years ago, In English

Hey, I'm relatively new to competitive programming, does anyone know what I did wrong here? http://codeforces.com/contest/810/submission/27251228

Thanks in advance

  • Vote: I like it
  • -7
  • Vote: I do not like it

| Write comment?
»
7 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Welcome to competitive programming

First of all, I don't think BigInteger is needed here. You can see that maximum products per day is 10^9, and there will be 10^5 days maximum. Therefore worst case you have to store up to 2*10^14, Long long (64-bit integer) should be enough

Try this input:

2 1
2 1000
3 6

Edit: wrong suggestion about reading the input