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

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

In the contest yesterday Codeforces Round 698 (Div. 1) I submitted 1477B - Nezzar и бинарная строка two times (105735241 and 105747088), both of the got verdict "TLE on pretest 2". So I spent much time trying to find the reason but failed. Today I just submitted the exactly same code as 105747088, and its verdict changed to "WA on test 2"! (105792669)

The truth is the code was wrong, so WA is the correct verdict. But where did TLE come from?

Could anyone explain about it to me? Thanks a lot!

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

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

I think split() have something wrong.

set<Element>::iter ret = odt.insert((Element){tmp.l,pos,tmp.x}).first; odt.insert((Element){pos+1,tmp.r,tmp.x});

ret may become an invalid pointer.

Your program using C++17 to submit will get TLE, and using C++17(64) to submit will get WA.

I think there's something wrong inside set.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +13 Проголосовать: не нравится

    You're right. Thank you very much.

    I didn't know that invalid pointer will lead to TLE. Also didn't I realize that I used different languages to submit.

    Sorry...I'm so weak.