AtCoder-5165 Kleene Inversion

This blog discusses the Kleene Inversion problem from AtCoder, detailing the problem statement, constraints, and providing an analysis of the solution. The author explains how to calculate the inversion number of a concatenated sequence, considering pairs of integers and modulo arithmetic." 137868606,5604553,Python基础实践:函数与算法挑战,"['Python', '开发语言', '算法']
摘要由CSDN通过智能技术生成

See the original article https://dyingdown.github.io/2019/11/22/AtCoder-5165-Kleene-Inversion/

Kleene Inversion

Problem Statement

We have a sequence of N integers A   =   A 0 ,   A 1 ,   ⋯   ,   A N − 1 A~=~ A_0,~A_1,~ \cdots,~A_{N−1} A = A0, A1, , AN1.

Let B be a sequence of K × N K \times N K×N integers obtained by concatenating K K K copies of A A A. For example, if A   =   1 ,   3 ,   2 A ~=~1,~3,~2 A = 1, 3, 2 and K   =   2 , B   =   1 ,   3 ,   2 ,   1 ,   3 ,   2 K ~=~2, B~=~1,~3,~2,~1,~3,~2 K = 2,B = 1, 3, 2, 1, 3, 2.

Find the inversion number of B, modulo 1 0 9 + 7 10^9+7 109+7.

Here the inversion number of B is defined as the number of ordered pairs of integers ( i ,   j )   ( 0 ≤ i < j ≤ K × N − 1 ) (i,~j)~(0≤i<j≤K \times N−1) (i,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值