abc150_c
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
问题描述
给定两个长度为 N 的1~N的排列 P, Q。
现在请求出两个排列在 1 ~ N 的全排列中的排名的差值的绝对值。
输入格式
第一行一个整数N。
第二行N个整数表示排列P。
第三行N个整数表示排列Q。
输出格式
一个整数。
数据范围
3
1 3 2
3 1 2
3
3个数的全排列有 123,132,213,231,312,321. 其中132排名为2,312排名为5,差值为3.
8
7 3 5 4 2 1 6 8
3 8 2 5 4 6 7 1
17517
10.1 国庆普及组训练
- Status
- Done
- Rule
- IOI
- Problem
- 8
- Start at
- 2024-10-1 8:00
- End at
- 2024-10-1 12:00
- Duration
- 4 hour(s)
- Host
- Partic.
- 12