Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

Автор jaglike_makkar, история, 3 года назад, По-английски

Please have a look at the following two submissions of 1582E - Пчеленок и подотрезки:

  1. 138848779
  2. 138849288

The first submission gave RTE on test 8. But just by replacing ll with int, it passed test 8. (Though it failed on test 9 due to integer overflow). Can anyone tell why is the first submission giving RTE? Any help is appreciated.

C++ is not my primary language, so I may be making some silly errors.

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

»
3 года назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

Just took a glance at your code and I saw that you declare the dp matrix locally, so probably you exceed the stack memory limit. Replacing with int, means halved memory so I think that's why you don't get RTE the second time