№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
Название |
---|
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...