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?
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3821 |
3 | Benq | 3736 |
4 | Radewoosh | 3631 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3388 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
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?
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?
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?
Name |
---|