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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 170 |
2 | Um_nik | 162 |
3 | atcoder_official | 160 |
3 | maomao90 | 160 |
5 | djm03178 | 158 |
5 | -is-this-fft- | 158 |
7 | adamant | 154 |
7 | Dominater069 | 154 |
9 | awoo | 152 |
9 | luogu_official | 152 |
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 |
---|