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

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

For this div3 problem (D),

I precalculate prefix frequencies of characters (editorial code does not), and I'm still getting TLE

My solve function's parameters are - 1. int c (character 0 is 'a', 25 is 'z') 2. int i (starting point of substring in consideration) 3. int j (length of the substring in consideration) [ using (1<<j) ]

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

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

You are memset-ing the entire cnt array for each test case, regardless of the size of n.

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

Memset. A silent killer.