| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3408 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 154 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 146 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | BledDest | 136 |
| 8 | adamant | 135 |
| 9 | maroonrk | 133 |
| 10 | cry | 130 |
|
+18
For each n let Fn be the number of permutations of {1, 2, . . . , n} with the required property; call them good. For n = 1, 2, 3 every permutation is good, so F1 = 1, F2 = 2, F3 = 6. Take an n > 3 and consider any good permutation (a1, a2, . . . , an) of {1, 2, . . . , n}. Then n − 1 must be a divisor of the number 2(a1 + a2 + · · · + an−1) So 2an − 2 must be divisible by n − 1, hence equal to 0 or n − 1 or 2n − 2. This means that an = 1 or an = (n + 1)/2 or an = n. Suppose that an = (n + 1)/2. Since the permutation is good, taking k = n−2 we get that n-2 has to be a divisor of 2(a1 + a2 + · · · + an−2) = 2(1 + 2 + · · · + n) − an − an−1 So 2an−1 − 3 should be divisible by n − 2, hence equal to 0 or n − 2 or 2n − 4. Obviously 0 and 2n − 4 are excluded because 2an−1 − 3 is odd. The remaining possibility (2an−1 − 3 = n − 2) leads to an−1 = (n + 1)/2 = an, which also cannot hold. This eliminates (n + 1)/2 as a possible value of an. Consequently an = 1 or an = n. If an = n then (a1, a2, . . . , an−1) is a good permutation of {1, 2, . . . , n−1}. There are Fn−1 such permutations. Attaching n to any one of them at the end creates a good permutation of {1, 2, . . . , n}. If an = 1 then (a1−1, a2−1, . . . , an−1−1) is a permutation of {1, 2, . . . , n−1}. It is also good because the number 2(a1−1) + · · · + (ak−1) = 2(a1 + · · · + ak) − 2k is divisible by k, for any k ≤ n − 1. And again, any one of the Fn−1 good permutations (b1, b2, . . . , bn−1) of {1, 2, . . . , n−1} gives rise to a good permutation of {1, 2, . . . , n} whose last term is 1, namely (b1+1, b2+1, . . . , bn−1+1, 1). The bijective correspondences established in both cases show that there are Fn−1 good permutations of {1, 2, . . . , n} with the last term 1 and also Fn−1 good permutations of {1, 2, . . . , n} with the last term n. Hence follows the recurrence Fn = 2Fn−1. With the base value F3 = 6 this gives the outcome formula Fn = 3 * 2n−2 for n ≥ 3. |
|
+6
Codefest'17 is excited to present a mathematical programming contest — Mathmania. It will bring a delectable collection of problems which will be an absolute delight for all the mathematics geeks. Cash prizes worth INR 50,000. |
|
+14
Requires an approximate algorithm. |
|
0
Auto comment: topic has been updated by divyam (previous revision, new revision, compare). |
|
+5
Linux users should use .out file. chmod u+x filename |
|
0
Auto comment: topic has been updated by divyam (previous revision, new revision, compare). |
|
+1
Auto comment: topic has been updated by divyam (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by divyam (previous revision, new revision, compare). |
|
+16
You can have a look at last year's contest to know more about the type of problems. |
|
+18
It will soon be available in the college contests section of Hackerrank. |
|
+22
There will be 10-12 problems. |
|
0
Auto comment: topic has been updated by divyam (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by divyam (previous revision, new revision, compare). |
|
0
Well, I have got my prize today and couple of my friends too. |
|
+9
I messaged them on Facebook a week ago and this was their reply — "Yes you will be getting it. The team is working on it. Apologies for the delay.." |
|
+15
Can anybody explain why my code is giving WA on test56 in c++11 while giving "accepted" in c++14 ? http://codeforces.me/contest/761/submission/24300137 |
|
0
How to solve "Cut into Palindromes" problem..?? |
| Name |
|---|


