We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 827f1a1 commit 77bf5dbCopy full SHA for 77bf5db
main/1100-1199/1110F.go
@@ -121,22 +121,11 @@ func cf1110F(_r io.Reader, _w io.Writer) {
121
}
122
for _, e := range g[v] {
123
p := nodes[e.to]
124
- l, r := p.l, p.r
125
- if l > 1 {
126
- t.update(1, 1, l-1, e.wt)
127
- }
128
- t.update(1, l, r, -e.wt)
129
- if r < n {
130
- t.update(1, r+1, n, e.wt)
131
+ t.update(1, 1, n, e.wt)
+ t.update(1, p.l, p.r, -e.wt*2)
132
f(e.to)
133
134
- t.update(1, 1, l-1, -e.wt)
135
136
- t.update(1, l, r, e.wt)
137
138
- t.update(1, r+1, n, -e.wt)
139
+ t.update(1, 1, n, -e.wt)
+ t.update(1, p.l, p.r, e.wt*2)
140
141
142
f(0)
0 commit comments