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

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

I was trying to solve 940E. The code is doing well on my computer, but i keep getting RUNTIME_ERROR. Can anyone kindly help me to find out the problem? The code is here Thanks

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

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

Look at the diagnosics: The AdressSanitizer claims an error, that means you try to access non-allocated memory. Here you try to access data[4] (in the first test case), but you only allocated a vector of length 4.

for(long long i=1;i<=k-1;i++)   {dp[i]=subsum[i];
         tmp.insert(data[i]);}