bati06's blog

By bati06, history, 4 years ago, In English

Hi Everyone,

I've tried to solve the CSES — Distinct Values Queries problem based on this StackOverflow answer.

Unfortunately I got TLE for my solution.

Can you guys help me, why I get TLE?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By bati06, history, 6 years ago, In English

I just solved the problem Facebook Hacker Cup 2015 — Round 1 — D. Corporate Gifting
My solution used "dp on tree" technique. The naive version would have used entire arrays in nodes that represents a discrete functions with its values. Because for every function all the function values are the same except one value, I can represent it with the common value, index of the difference, and the difference itself. Using this simpler representation the calculation of the sum of the functions will have lower complexity.
I wonder if this technique (of representing discrete functions this way) has some other useful applications. Is there any reading about this topic?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By bati06, history, 6 years ago, In English

It seems that search function (on the upper right corner of the site) doesn't work for me. I don't get any result even if I enter frequently used phrases like "graph", "tree", "competition". If I get any result it is just one user with the searched phrase. But I'd like to search for blog posts.
Anyway I can search on google, but I'm interested in whether I am the only one who can't use this function of the site, or is it wrong for everybody. In the latter case where should I send feedback to?

Full text and comments »

  • Vote: I like it
  • +28
  • Vote: I do not like it