| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 147 |
| 4 | Proof_by_QED | 146 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 142 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
|
0
Thanks for the explanation. |
|
0
Thanks. |
|
+4
Problem C: I did the same n! — 2^(n-1) but got wrong answer on pretest 6. Can anyone tell me what's wrong? Here is the link to my solution |
|
0
Nope. AFAIK you cannot create a hash sum array for this question. You have to create a freq array of numbers and then run a loop from (2 to 2*n) and then search on the freq array for the sum, as given in the editorial. |
|
0
Yes, you have to select the weight with the maximum frequency. But the way you are creating the sum array is wrong because that loop is running n^2 times and creating almost n^2 pairs. The problem is that when you hash them to the sum variable, you are using one person more than once (in different pars), which leads to a wrong sum array. |
|
0
In the first for loop you are doing sum[a[i]+a[j]]++ which is wrong because lets say there are 3 people with weights {1,3,3} In the first iteration , you are using the zeroeth person thrice (when (i,j) is (0,0) (0,1) (0,2)). In the first iteration itself sum[4] will be 2 which is not possible since if the zeroeth person made a team with the first person for sum=4, he cannot make another team with the second person. As a person cannot be in 2 teams, this approach fails. |
|
On
AbhayChandna →
Codeforces Round #642 (Div. 3) Problem E — K-periodic Garland (Help in sample testcase), 6 years ago
0
Ohhhhh... Got it now Thanks a lot. |
|
On
AbhayChandna →
Codeforces Round #642 (Div. 3) Problem E — K-periodic Garland (Help in sample testcase), 6 years ago
0
Auto comment: topic has been updated by AbhayChandna (previous revision, new revision, compare). |
| Name |
|---|


