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

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

I've tried every possible way to figure out the problem. But could not figure it out still why it's getting a runtime error on Test Case 3. Please can someone help me with this?? Here's the code 249223416 and here's the problem 1791F - Range Update Point Query

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

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

Auto comment: topic has been updated by SystemTesting (previous revision, new revision, compare).

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

You don't need to do allat bro. I haven't done competitive programming in YEARS, but I think literally all you have to do is calculate the digital root for each a_i until you end up with a single digit (and you literally could save this in a N by 4 array or sum), use a difference array to simulate the range queries, and then answer the queries that way (it's O(N) too).

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

Because you dereference it (in the end of cycle) after possible erasing (in successful if num < 10)