Hello CFC (Codeforces community).
What is the most beautiful problem, you have seen on Codeforces?
Why do you think so?
Come on!
Please share beautiful problems you have seen on Codeforces.
# | 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 | maomao90 | 161 |
4 | atcoder_official | 160 |
5 | djm03178 | 158 |
5 | -is-this-fft- | 158 |
7 | adamant | 154 |
7 | Dominater069 | 154 |
9 | awoo | 152 |
9 | luogu_official | 152 |
Hello CFC (Codeforces community).
What is the most beautiful problem, you have seen on Codeforces?
Why do you think so?
Come on!
Please share beautiful problems you have seen on Codeforces.
Name |
---|
For me its the most beautiful problem if I could not able to solve it
First of all I should say that I read tags :)
My favorite problem is Powerful array. It has a very useful idea.
nice problem :) can u explain the idea behind dividing the array into p equal parts Q_1, ..., Q_p then sorting them according to the rule mentioned in the editorial ?? how does that improve run time from order O(n^2) to o(n*sqrt(t))??
First we divide the array into sq = sqrt(n) equal parts Q1, Q2, ..., Qsq , then we sort the queries and answer them offline.
For each part we sort the queries with l inside that part by their r.(Is this part clear?)
Then we use a kind of two pointer to answer the queries. We have two pointers s and e representing the segment that we have its answer at the time and an integer tot representing the answer of the segment [s, e].(At the beginning s = e = 0 and we have the answer of the [s, e] equal to a0)
When we want to know the answer of a segment [l, r] we simply move s to l and e to r. As we have a good sorting the total number of times we move s and e is not too much :)
let's see how s and e move.
We answer the queries of each part separately so if we prove that the number of times we move e in Qi is in O(n) then we can say that the total number times we move e is O(n * sqrt(n)).
As we sorted the queries in each part by their r so e moves at most n times(in each part). So e moves a total of n * sqrt(n) times(at the worst time).
Also for each query we change s at most sqrt(n) times (from the beginning of Q_i to the end of it) so the total number of times we change s is O(n * sqrt(n)).
Now it's easy to say that the total number of our moves is O(n * sqrt(n)). :)
Tell me if it was not clear enough.
One of the most beautiful problems I have solved that come to mind now is Top 10, from Jakarta 2009. I tried it a few months ago while I was learning Suffix Array, and I was blown away by it. It combines many useful techniques and algorithms. It's just sublime.
Here's the link -> Top 10
I solved that problem just sorting, test cases are weak but is a beautiful problem.
Auto comment: topic has been updated by Kuzey (previous revision, new revision, compare).