| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | dXqwq | 3436 |
| 8 | Radewoosh | 3415 |
| 9 | Otomachi_Una | 3413 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | adamant | 152 |
| 3 | Proof_by_QED | 146 |
| 3 | Um_nik | 146 |
| 5 | Dominater069 | 144 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 9 | TheScrasse | 134 |
|
+10
OK, here is the explanation of my thoughts: First, deal with the three largest numbers as the tuterial mentioned, put them at the rear, then the problem is how to arrange the other numbers. if we calculate a value $$$k_i$$$ for every $$$a_i$$$ such that $$$2^{k_i}{\leq}a_i{ \lt }2^{k_{i}+1}$$$, we can make sure that for any three $$$a_i$$$ with the same $$$k$$$, one number plus another is always larger than the other one. Therefore, we can find all the $$$k_i$$$ at first and put all the $$$a_i$$$ with the same $$$k$$$ together. As for $$$a_i$$$ with different $$$k$$$, since the number with larger $$$k$$$ is also larger, so we can arrange $$$a_i$$$ with smaller $$$k$$$ first, then the number with larger $$$k$$$. Besides, for every $$$a_i$$$ with the same $$$k$$$, the smallest should always be arranged at first to make sure the number after it is greater or equal to it. The complexity of finding the three largest numbers is $$$O(n)$$$. All the $$$k_i$$$ can be found using binary search, so the complexity of calculating all the $$$k_i$$$ is $$$O(nloglog(max(a)))$$$. As to finding all the smallest $$$a_i$$$ with the same $$$k$$$, the complexity is $$$O(n)$$$. Therefore, the total complexity is $$$O(nloglog(max(a)))$$$. Since $$$max(a)$$$ is $$$10^9$$$, I think it is very close to $$$O(n)$$$ already. |
|
+1
I have done the challenge of div.2 B but I'm in a hurry so that I cannot check if it is right. It looks like the complexity is O(n), maybe somebody could check it for me? |
|
0
I just check the length of every continuous identical row and calumn as well, and then take the GCD of them as the answer. I'm not sure if it is right, but it passed the judge. |
| Name |
|---|


