Блог пользователя Pl4gue

Автор Pl4gue, история, 9 лет назад, По-английски

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

Thanks in advance

  • Проголосовать: нравится
  • -7
  • Проголосовать: не нравится

»
9 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

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