有一个数字序列A{a1,a2,a3,a4 .... an}和一个调整策略T{t1,t2,t3,t4 .... tn},
其中调整策略的序列表示:
a1将转换到A序列的t1位置,
a2将转换到A序列的t2位置
....
求按照T策略转换多少次能还原A序列(最少一次)。
有一个数字序列A{a1,a2,a3,a4 .... an}和一个调整策略T{t1,t2,t3,t4 .... tn},
其中调整策略的序列表示:
a1将转换到A序列的t1位置,
a2将转换到A序列的t2位置
....
求按照T策略转换多少次能还原A序列(最少一次)。
4
1 2 3 4
3
2 3 1
1
3
Please, do not write the \_\_int64 specifier to read or write 64-bit integers in С++.
It is preferred to use the cin, cout streams or the %lld(long long) specifier.