# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Name |
---|
The only advice for you is "Read the Problem Again"
You have assumed that movements in the x and y-axis are independent but it is not true. Let's say that we have segments s1, s2, s3, s4, s5, s6, s7. What your code does is it solves independently for s1, s3, s5, s7, and s2, s4, s6 and gives the minimum for each axis (Here odd index segments refer to one axis and the even index segment axis refers to another axis). But what the question says is; say you are using segment s5, then it is necessary that you have used segment s1, and s3 as well as s2 and s4. But your code does not consider this.
Question requirement: For using Si, the coefficients of segments 1 <= j < i must be at least 1 and the sum of coefficients at odd index must be N and at even indices must also be N.
Your code: For using Si, the coefficients of segments 1 <= j < i must be at least 0.
Sample Test Case:
1
6
100 1 100 100 1 100
Expected Output: 309
Your Output: 210
Thanks a lot man...