QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 512 MB 満点: 100 ハック可能 ✓

#11371. JB 想要赚大钱

統計

JB 一直想赚大钱,所以最近他沉迷于股票。

股票市场的交易规则如下。假设有 $n$ 个人想要买入股票,有 $m$ 个人想要卖出股票。每个人都会给出一个价格。

系统会确定一个最终价格 $x$。对于想要买入股票的人,如果他给出的价格不低于 $x$,他就能参与交易。对于想要卖出股票的人,如果他给出的价格不高于 $x$,他就能参与交易。

现在,JB 给了你这些人给出的价格以及最终价格 $x$。他想让你告诉他有多少人能够参与交易。

输入格式

第一行包含三个数字 $n, m$ 和 $x$ ($1 \le n, m, x \le 10^5$),分别表示两类人的数量以及系统确定的最终价格。

第二行包含 $n$ 个数字 $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^5$),表示想要买入股票的人给出的价格。

第三行包含 $m$ 个数字 $b_1, b_2, \dots, b_m$ ($1 \le b_i \le 10^5$),表示想要卖出股票的人给出的价格。

输出格式

输出一个数字,表示能够参与交易的人数。

样例

输入 1

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

输出 1

6

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.