| # | 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
The sign of c does not matters. The only thing that matters is the sign of $$$(cx + d)$$$ because what we want to know is $$$\sum |c_ix + d_i|$$$. We know that $$$|c_ix + d_i| = c_ix + d_i$$$ when $$$c_ix + d_i \geq 0$$$ are hold, and $$$|c_ix + d_i| = -c_ix -d_i $$$ when $$$c_ix + d_i \lt 0$$$ are hold. If $$$c_i$$$ is positive, the inequality $$$c_ix + d_i \geq 0$$$ holds when $$$x \geq -\frac{d_i}{c_i}$$$, but if $$$c_i$$$ is negative, it will holds when $$$x \leq -\frac{d_i}{c_i}$$$ To avoid this, we found that $$$|c_ix + d_i| == |-c_ix - d_i|$$$, so we can change $$$|c_ix + d_i|$$$ into $$$|-c_ix - d_i|$$$ if $$$c_i$$$ is negative. After doing this, we can sort all $$$c_i, d_i$$$ in the order of $$$\frac{d_i}{c_i}$$$. After doing this, we can used binary search to find a position that for all $$$c_i, d_i$$$ before it $$$c_ix + d_i \geq 0$$$ and for all $$$c_i, d_i$$$ after it $$$c_ix + d_i \lt 0$$$ |
|
+3
You can change c into positive because $$$ |cx + d| $$$ = $$$ |-cx - d| $$$. Although he didn't write it in the tutorial, you can see it in his code |
|
+9
JeevanJyot I think this might be a mistake in your tutorial. I see that you change $$$ |cx + d| $$$ into $$$ |-cx - d| $$$ if c is negative in your code, you should write it in your tutorial. |
|
+8
I've got a little confusion according to tutorial of problem E. $$$ |cx + d| $$$ = $$$ cx + d $$$ exist when $$$ cx + d \geq 0 $$$ which is $$$ cx \geq -d $$$. When $$$ c \gt 0 $$$, the range of x will be $$$ x \geq -\frac{d}{c} $$$ When $$$ c \lt 0 $$$, the range of x will be $$$ x \leq -\frac{d}{c} $$$ But in the tutorial, it says $$$ |cx + d| = cx + d $$$ $$$ x \geq -\frac{d}{c}$$$ Could anyone explain it to me? |
|
0
I think there might be some mistakes according to tutorial of problem F. In the tutorial it said: "However, the tricky case is to deal with cells with 0 unmarked neighbors". But it is obvious that cells with 0 unmarked neighbors will get the value of 0 in the end. So what is really tricky to deal with is those cells with 4 unmarked neighbors. I think the writer might confuses the definitions of marked and unmarked cell. |
| Name |
|---|


