Responsive image

问题 1832 --Yuno And Claris

1832: Yuno And Claris

时间限制: 4 Sec  内存限制: 128 MB
提交: 5  解决: 0
[提交][状态][讨论版][命题人:]

题目描述

Yuno failed in a contest, so she was forced to wear JK dress.

Claris AKed in a contest, so she bought some JK dresses for Yuno to wear, each dress has a price.

Because Claris has lots of money, she bought n dresses, and put them in an array a1,a2,...,an.





Because Yuno loves data structure, she invented 2 kinds of operations :

1 l r x y : Change all the dresses in al,al+1,...,ar with price x to price y.

2 l r k : Yuno wants to wear the k-th cheapest dress in al,al+1,...,ar, please tell her the price of it.

输入描述

The first line of the input contains an integer T(1≤T≤10), denoting the number of test cases.
In each test case, there are 2 integers n,m(1≤n,m≤100000) in the first line, denoting the number of dresses and the number of operations.
In the next line, there are n integers a1,a2,...,an(1≤ai≤n), denoting the price of each dress.
In the following m lines, each line describes an operation.
If it is a modification, then it is in the format of ''1 l r x y'', where 1≤l≤r≤n and 1≤x,y≤n.
If it is a query, then it is in the format of ''2 l r k'', where 1≤l≤r≤n and 1≤k≤r−l+1.
 

输出描述

For each query, print a single line with an integer, denoting the answer.

样例输入

1
3 3
2 3 3
2 1 3 1
1 1 3 3 1
2 1 3 2

样例输出

2
1

来源

 

[提交][状态]
ACM算法攻关部
  • Anything about this OnlineJudge, Please Contact Administrator. Click add QQ

    OJ system based on HUSTOJ Project , UI based on Twitter Bootstrap

    Copyright 2016 ACM算法攻关部
    关于网站改版