ADALIST - Ada and List

TimeLimit:7000MS  MemoryLimit:156MB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem Description

Ada the Ladybug has a TODO-list (containing only numbers - for simplicity). She is still doing something, so she sometimes erases kth number, sometimes she inserts something on kth position and sometime she asks for kth number.

Sadly, she is now searching for a work at position k so she doesn't have time to do this herself. Can you help her

Input

The first line will contain 0 < N ≤ 105,0 < Q < 5*105, the number of elements in TODO-list and number of queries.

Then a line with N numbers follows. Each number 0 ≤ Ak ≤ 109 means kth number in her TODO-list.

Afterward, Q lines follow, each beginning with number 1 ≤ a ≤ 3

1 k x means that you will add number x to position k

2 k means that you will erase number from position k

3 k means that you will print number from position k

For all queries, it is true that 1 ≤ k ≤ #SizeOfList, 0 ≤ x ≤ 109 (for query 1, it can be also put to position #SizeOfList + 1)

You will never get query of type 2 or 3 if the list is empty


Output

For each query of type 3, print kth numbers

SampleInput
6 10
1 2 4 8 16 32
3 4
1 1 7
3 2
2 2
2 2
3 2
1 6 666
3 6
2 1
3 1
SampleOutput
8
1
4
666
4
Submit
题目统计信息详细
总AC数0
通过人数0
尝试人数9
总提交量14
AC率0.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: