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

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

HI,
After I got the idea of this problem and solved it true, it's my first time to solve E during contest but sadly I got TLE it seems that the time limit is too strict.
I used loop in My Ternary search (my loop limit is 400 ) and It got TLE ,after the contest I changed it to 398 and it suddenly passed.
I asked about that in a comment and ho-jo-bo-ro-lo told me he use 500 in loop and it passed but I have to use cin.tie(0);
what about submitting the same code twice with cin.tie(0) one got TLE and the other got Accepted.
Accepted
Time limit exceeded on test 22
during the contest I got TLE on Testcase #15 so if the TLE because reading and writing speed I think testcase 13,14 has the maximum limit and similar numbers so why it passed them and failed in 15.
Thanks

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

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

Why ternary? Binary, let's look. It's easier and faster. Second. 400 — it's too much. 100-200 for ternary search it's enough, 30-50 it's enough for binary(i used 100 because time limit was very good)