A7773 | Ball
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
$N$ ladies attend the ball in the King's palace. Every lady can be described with three values: beauty, intellect and richness. King's Master of Ceremonies knows that ladies are very special creatures. If some lady understands that there is other lady at the ball which is more beautiful, smarter and more rich, she can jump out of the window. He knows values of all ladies and wants to find out how many probable self-murderers will be on the ball. Lets denote beauty of the $i$ -th lady by $B_{i}$ , her intellect by $I_{i}$ and her richness by $R_{i}$ . Then $i$ -th lady is a probable self-murderer if there is some $j$ -th lady that $B_{i}<B_{j},I_{i}<I_{j},R_{i}<R_{j}$ . Find the number of probable self-murderers.
输入格式
The first line contains one integer $N$ ( $1<=N<=500000$ ). The second line contains $N$ integer numbers $B_{i}$ , separated by single spaces. The third and the fourth lines contain sequences $I_{i}$ and $R_{i}$ in the same format. It is guaranteed that $0<=B_{i},I_{i},R_{i}<=10^{9}$ .
输出格式
Output the answer to the problem.
输入输出样例
输入 #1
3 1 4 2 4 3 2 2 5 3
输出 #1
1
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted