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

Автор Mahfuz2411, история, 17 месяцев назад, По-английски

Problem : 86D - Powerful array My submission: 193616090

I don't understand what I'm doing wrong here?

This problem can be solved using Moss algorithm. So I was trying to solve this with moss algorithm but still time limit for test case no 6.

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

»
17 месяцев назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

q1.l-1/rootN == q2.l-1/rootN is evaluated as q1.l-(1/rootN) == q2.l-(1/rootN) due to the order of operations. You want to add parenthesis around the subtraction since that is what you're trying to do: (q1.l-1)/rootN == (q2.l-1)/rootN