Distinct Sums Grid
I tried then searched for the solution online but could not find it anywhere. If anybody has solved it please do share the solution here or in private. Thanks in advance.
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | jiangly | 3631 |
| 4 | Kevin114514 | 3574 |
| 5 | maroonrk | 3521 |
| 6 | strapple | 3515 |
| 7 | Radewoosh | 3461 |
| 8 | tourist | 3428 |
| 9 | turmax | 3378 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 162 |
| 2 | adamant | 148 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 143 |
| 5 | errorgorn | 140 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 133 |
Distinct Sums Grid
I tried then searched for the solution online but could not find it anywhere. If anybody has solved it please do share the solution here or in private. Thanks in advance.
| Name |
|---|



I am stuck on the first two first two problems like I know what to do, but just cant implement it, please help
for the first one try to go greedy. take all the elements in a dq and use the largest element in the dq if the number of inversions needed is more than the remaining elements. if this sounds confusing you can take a look at the code :
The second is just intuition or observation just to say. Try to think when the case is impossible. Rest of the logic follows.
in case of possible events for example if n = 10 try printing the last k elements first then the last k elements before that and so on.
If you are still stuck :
thanks
https://mirror.codeforces.com/blog/entry/151589
Let's maybe not blidnly downvote this, it's a nice problem and the only solution I've seen is not too satisfying (which linked in the comments and uses random swaps).
It would be interesting to know a deterministic (number theoretic / D&C / latin square)-based solution.
whoops, what i suggested has a mistake, never mind
Yeah, same here. I posted a comment code and it was wrong, tho I thought it was latin square when I saw it honestly
Sorry, this answer was wrong.