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

Автор Shameek, 6 лет назад, По-английски

my code click here im getting runtime error (SIGSEGV) on 11th testcase..why? i have also increased the SIZE significantly as people were saying in the comment section that its more than 10^5.. i dont see a reason for long long as well in the question.. can someone please help??

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

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

Hm. Is it correct?

    if (cc >= cnt)
        return query(u->l, v->l, lc->l, lcp->l, cnt, s, m);
    else
        return query(u->r, v->r, lc->r, lcp->r, cnt - cc, m + 1, e);

Seems the condition should be if( cc <= cnt ).