| # | User | Rating |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3447 |
| 6 | Um_nik | 3387 |
| 7 | heuristica | 3322 |
| 8 | turmax | 3317 |
| 9 | tourist | 3307 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 156 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 141 |
| 5 | Errichto | 139 |
| 6 | adamant | 137 |
| 7 | AmShZ | 135 |
| 8 | BledDest | 132 |
| 9 | maroonrk | 131 |
| 10 | qwexd | 129 |
|
+21
You don't read books like these, you study them. Ten pages in one reading sounds fine, possibly too much. You're supposed to do the exercises as well, not only read the theory, only then you can claim you've understood the stuff. It's better to have with your own questions before you start reading. (Like "I wonder what's the reasoning behind using red-black trees for C++ STL maps and sets, can the Cormen's book answer that?" and "What's the best data structure to use in this problem I have?") That typically gives me motivation to try to understand the technical material. It's also important to select the right level of the book and the right approach: some people like more theoretical approach, while others (like me) are more into practical, applied stuff like "how to create computer games". This is completely subjective; you need to pick what you personally find interesting and compelling. |
|
0
The approach is broadly correct. I just implemented it to test: 15667843. However:
|
|
0
Umm, no, it's better to use quicksort. Proof — this text from Skienna, Algorithm Design Manual:
Basically quicksort has better cache locality. Most C++ standard library implementations use a combination of quicksort and insertion sort as their implementation for |
|
+11
Looks like someone went through the trouble to generate an extremely bad test case input for hacking 620C - Pearls in a Row. Now the hack is included in the system tests as Test 42. It causes a huge number of collisions in that specific G++ implementation of unordered map.
To the OP: good idea to change the max load factor! Looks like a simple solution compared to writing a custom hash function. Tweaking the load factor + pre-creating many buckets (with |
|
+14
In problem C:
What exactly is test 42? Looks like someone went through the trouble to generated an extremely bad test case input that causes huge number of collisions in that specific G++ implementation of unordered map. In my opinion, it's a bit against the spirit of the competition ;) |
|
On
shakil_AUST →
What do you think when you set problem for a programming contest/challenge. , 11 years ago
+4
Check out contest #472, it's a kind of problem setting tutorial. Each problem in it has a different source of inspiration, as you can see from their names and descriptions. |
|
0
See my answer to masterwayne |
|
0
Here are some hints: http://math.stackexchange.com/questions/266569/how-to-find-the-root-of-permutation The answer still may be too advanced to understand if haven't studied the math of permutation groups. Basically, every permutation can be expressed in a cyclic notation. To do that, first write the permutation as multiplication of transpositions (a transposition is a cycles with two elements). For the example
Now some transpositions can be merged. In fact in this example all of them can be merged, but that will not always be the case:
The resulting cycle of length 5 denotes the same original permutation Now if In the example, The analysis so far works for cycles with odd length. For a cycle with even length To solve the exercise, you need to do the opposite: permute every odd-sized cycle back, and merge every pair of same-sized even cycles. (If there are more than one pair of cycles with size Finding the cycles in the given permutation requires some preprocessing, but it can be done in |
|
+11
Standard name lookup rules apply to your example. It compiles for the same reason why the next example compiles — because the inner scope is always looked up first unless the And the other way around: trying to define a variable and a type in the same scope with the same name leads to an error. |
|
+20
One clear practical difference is that names introduced by |
|
0
You can post a link to you submission. When looking at your profile history, I see the submission history anyway. Your I/O is too slow. There has been written a lot about First, do not use Second, add this code at start of Then try again and it should be AC. |
|
+8
Internally |
|
0
Auto comment: topic has been updated by kfx (previous revision, new revision, compare). |
|
0
Was problem C so difficult to get right because it required to use long double? Changed mine solution from double to long double and got AC: http://codeforces.me/contest/598/submission/14258763 |
| Name |
|---|


