CF12D.Ball
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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 Bi , her intellect by Ii and her richness by Ri . Then i -th lady is a probable self-murderer if there is some j -th lady that Bi<Bj,Ii<Ij,Ri<Rj . Find the number of probable self-murderers.
输入格式
The first line contains one integer N ( 1<=N<=500000 ). The second line contains N integer numbers Bi , separated by single spaces. The third and the fourth lines contain sequences Ii and Ri in the same format. It is guaranteed that 0<=Bi,Ii,Ri<=109 .
输出格式
Output the answer to the problem.
输入输出样例
输入#1
3 1 4 2 4 3 2 2 5 3
输出#1
1