Problems
Note: We suggest using a language other than Python to earn full credit on this problem.
Farmer John's
FJ is taking his cows to a checkup at a local bovine hospital. However, the bovine veterinarian is very picky and wants to perform a checkup on the
FJ is lazy and does not want to completely reorder his cows. He will perform the following operation exactly once.
Select two integers
FJ wants to measure how effective this approach is. For each
Input
The first line contains an integer
The second line contains
The third line contains
Output
Output
Subtask
| # | Score | Condition |
|---|---|---|
| #1 | 30 | |
| #2 | 70 | |
Example #1
3
1 3 2
3 2 1
3
3
0
0
If FJ chooses (
The following operations result in one cow being checked.
l=1,r=2 : FJ reverses the order of the first and second cows so the species of each cow in the new lineup will be[3,1,2] . The first cow will be checked.l=2,r=3 : FJ reverses the order of the second and third cows so the species of each cow in the new lineup will be[1,2,3] . The second cow will be checked.l=1,r=3 : FJ reverses the order of the first, second, and third cows so the species of each cow in the new lineup will be[2,3,1] . The third cow will be checked.
Example #2
3
1 2 3
1 2 3
0
3
0
3
The three possible operations that cause
Example #3
7
1 3 2 2 1 3 2
3 2 2 1 2 3 1
0
6
14
6
2
0
0
0
he two possible operations that cause