atcoder#ARC123B. [ARC123B] Increasing Triples
[ARC123B] Increasing Triples
Score : points
Problem Statement
Given are three sequences of integers each: $A = (A_1, \ldots, A_N),\,B = (B_1, \ldots, B_N),\,C = (C_1, \ldots, C_N)$.
You can permute each of these sequences in any way you like. Find the maximum possible number of indices such that after permuting them.
Constraints
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
5
9 6 14 1 8
2 10 3 12 11
15 13 5 7 4
3
We should permute them as follows:
- ,
- ,
- .
Then, we will have three indices () such that .
1
10
20
30
1
3
1 1 1
1 1 2
2 2 2
0