|
LooploopTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1859 Accepted Submission(s): 607
Problem Description
XXX gets a new toy named Looploop. The toy has N elements arranged in a loop, an arrow pointing to one of the elements, and two preset parameters k1 and k2. Every element has a number on it.
![]() The figure above shows a Looploop of 6 elments. Let's assuming the preset parameter k1 is 3, and k2 is 4. XXX can do six operations with the toy. 1: add x Starting from the arrow pointed element, add x to the number on the clockwise first k2 elements. ![]() 2: reverse Starting from the arrow pointed element, reverse the first k1 clockwise elements. ![]() 3: insert x Insert a new element with number x to the right (along clockwise) of the arrow pointed element. ![]() 4: delete Delete the element the arrow pointed and then move the arrow to the right element. ![]() 5: move x x can only be 1 or 2. If x = 1 , move the arrow to the left(along the counterclockwis |
HDU4453(伸展树模板题)
最新推荐文章于 2021-08-19 17:46:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)