Type: Default 1000ms 256MiB

做题

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题意

NN 道题和 MM 名选手。第 ii 个题的难度是 AiA_i,第 jj 名选手的最多能做难度为 BjB_j 的题。

请你找出一个最小的难度 xx,使得难度小于等于 xx 的任务数量大于等于能做难度 xx 的选手数量。

输入格式

第一行 tidtid

第二行有两个整数 N,MN,M

第三行有 NN 个整数,第 ii 个为 AiA_i

第四行有 MM 个整数,第 ii 个为 BiB_i

tidtid 表示属于第几个测试点,测试样例 tidtid00

输出格式

一行一个整数,为最低难度 xx

输入输出样例 #1

输入 #1

0
3 4
110 90 120
100 80 120 10000

输出 #1

110

输入输出样例 #2

输入 #2

0
5 2
100000 100000 100000 100000 100000
100 200

输出 #2

201

输入输出样例 #3

输入 #3

0
3 2
100 100 100
80 120

输出 #3

100

【数据范围】

对于所有的数据

  • 1N,M2×1051 \le N,M \le 2 \times 10^5
  • 1Ai,Bi1091 \le A_i,B_i \le 10^9
测试点编号 nn mm 特殊性质 测试点分值
11 100\leq 100 1010
22 1000\leq 1000 1818
33 2×105\leq 2\times10^5 7272

暑假集训模拟赛1

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2025-8-15 14:10
End at
2025-8-15 18:10
Duration
4 hour(s)
Host
Partic.
8