Problem 3779 --zoto

3779: zoto

"
Time Limit $1$ 秒/Second(s) Memory Limit $128$ 兆字节/Megabyte(s)
提交总数 $4$ 正确数量 $1$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签
You are given an array fx.
For each i(1<=i<=n) , we use a point (i,fx[i]) in XoY coordinate plane to described it. 
You are asked to answer m queries, in each query there will be a rectangle and you need to count how many different y-cooordinate (of the points mentioned above) in the queried rectangle.
The first line contains an integer T(1<=T<=5) representing the number of test cases.
For each test case , there are twointegers n,m(1<=n<=100000,1<=m<=100000) in the first line.
Then one line contains n integers fx[i](0<=fx[i]<=100000) Each of the next m lines contain four integers x0,y0,x1,y1(1<=x0<=x1<=n,0<=y0<=y1<=100000) which means matrix's lower-leftmost cell is (x0,y0) and upper-rightest cell is (x1,y1).
For each test case print a single integer in a new line.
1
4 2
1 0 3 1
1 0 4 3
1 0 4 2
3
2

推荐代码 查看3779 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$517 $ms] 大喵-sama 951922 2023-04-07 20:59:59
内存最少[$7324 $KB] 大喵-sama 951922 2023-04-07 20:59:59
第一AC 大喵-sama 951922 2023-04-07 20:59:59
第一挑战 大喵-sama 951917 2023-04-07 20:58:25

赛题来源/所属竞赛 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛