Why TLE even though time complexity is ok (DP)?

Правка en1, от LogitechSellout, 2019-04-26 06:11:39

Hi, I'm pretty new to CF and this is one of my first problems here

Problem Statement: https://codeforces.com/problemset/problem/245/H Basically you want to answer q queries, each stating the number of palidromes between two indicies of a long string

My code: https://codeforces.com/contest/245/submission/53304310

For some reason CF seems to time out, even though time complexity is alright (O(s^2+q)) which is quite odd

Could this because of my programming language? I know that java tends to be slow in these contests

Теги debugging, dp, tle

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский LogitechSellout 2019-04-26 06:11:39 583 Initial revision (published)