CF863D.Yet Another Array Queries Problem

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given an array aa of size nn , and qq queries to it. There are queries of two types:

  • 11 lil_{i} rir_{i} — perform a cyclic shift of the segment [li,ri][l_{i},r_{i}] to the right. That is, for every xx such that li<=x<ril_{i}<=x<r_{i} new value of ax+1a_{x+1} becomes equal to old value of axa_{x} , and new value of alia_{li} becomes equal to old value of aria_{ri} ;
  • 22 lil_{i} rir_{i} — reverse the segment [li,ri][l_{i},r_{i}] .

There are mm important indices in the array b1b_{1} , b2b_{2} , ..., bmb_{m} . For each ii such that 1<=i<=m1<=i<=m you have to output the number that will have index bib_{i} in the array after all queries are performed.

输入格式

The first line contains three integer numbers nn , qq and mm ( 1<=n,q<=21051<=n,q<=2·10^{5} , 1<=m<=1001<=m<=100 ).

The second line contains nn integer numbers a1a_{1} , a2a_{2} , ..., ana_{n} ( 1<=ai<=1091<=a_{i}<=10^{9} ).

Then qq lines follow. ii -th of them contains three integer numbers tit_{i} , lil_{i} , rir_{i} , where tit_{i} is the type of ii -th query, and [li,ri][l_{i},r_{i}] is the segment where this query is performed ( 1<=ti<=21<=t_{i}<=2 , 1<=li<=ri<=n1<=l_{i}<=r_{i}<=n ).

The last line contains mm integer numbers b1b_{1} , b2b_{2} , ..., bmb_{m} ( 1<=bi<=n1<=b_{i}<=n ) — important indices of the array.

输出格式

Print mm numbers, ii -th of which is equal to the number at index bib_{i} after all queries are done.

输入输出样例

  • 输入#1

    6 3 5
    1 2 3 4 5 6
    2 1 3
    2 3 6
    1 1 6
    2 2 1 5 3
    

    输出#1

    3 3 1 5 2 
    
首页