PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#CC0000060. So sánh ba chỉ số tại buổi dạ hội (Ball)
HỌC THEO LỘ TRÌNH
2 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
So sánh ba chỉ số tại buổi dạ hội (Ball)
Ball
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Each of the people has three attributes: beauty , intellect , and richness . Count the people for whom there exists another person with all three attributes strictly greater.
Input
The first line contains . The next three lines contain beauty , intellect and richness respectively.
Output
Print the number of people strictly dominated on all three attributes.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
3
1 4 2
4 3 2
2 5 3
Output
1
Explanation
Person 2 (4,3,5) strictly dominates person 3 (2,2,3). Neither of the others is dominated in all three dimensions.