Codeforces Round #594 (Div. 2) B. Grow The Tree 水题

B. Grow The Tree

Gardener Alexey teaches competitive programming to high school students. To congratulate Alexey on the Teacher's Day, the students have gifted him a collection of wooden sticks, where every stick has an integer length. Now Alexey wants to grow a tree from them.

The tree looks like a polyline on the plane, consisting of all sticks. The polyline starts at the point (0,0). While constructing the polyline, Alexey will attach sticks to it one by one in arbitrary order. Each stick must be either vertical or horizontal (that is, parallel to

上一篇:Codeforces Round #339 Div.2 A - Link/Cut Tree


下一篇:Learning Core Data 1