-
zuixin
dft频率测量算法,主要针对电网频率的测量(the dft frequency measurement algorithm)
- 2013-03-28 23:00:39下载
- 积分:1
-
LBM 封闭腔体自然对流
封闭方腔自然对流格子布尔兹曼程序,在瑞利数为2000及4000时的两种算例,包括说明文字。(Closed square cavity natural convection lattice Boltzmann method)
- 2021-03-19 05:29:19下载
- 积分:1
-
matlab
基于二阶锥规划的旁瓣抑制滤波器的设计仿真,其中包括m序列,失配滤波器设计,并且考虑增益处理损失。(Based on SOCP sidelobe suppression filter design simulation, including m-sequence mismatch filter design, and to consider the loss of gain processing.)
- 2020-12-02 15:39:26下载
- 积分:1
-
q-learning
q-learning的一个解释性例子.压缩文件有两个m文件构成,运行后可输出结果。(q-learning with matlab)
- 2010-12-05 23:43:11下载
- 积分:1
-
gap-width-and-JRC
计算岩石表面裂隙宽度并求取其表面粗糙度系数(Calculate the rock surface crack width and strike the surface roughness coefficient)
- 2016-02-18 03:01:04下载
- 积分:1
-
Gauss
matlab中高斯迭代法使用的m文件,可以用于方程组近似值的求解。(m file matlab Gauss iterative method can be used for approximation of solving equations.)
- 2012-06-04 18:55:14下载
- 积分:1
-
cube_0p1mm
说明: abaqus周期性边界条件代码,可以参考学习(ABAQUS periodic boundary condition code can refer to learning)
- 2020-08-13 22:08:28下载
- 积分:1
-
SVMcgForRegress
说明: 支持向量机中的支持向量回归函数对数据进行预测(Support Vector Regression Function in Support Vector Machine to Predict Data)
- 2019-05-12 16:42:10下载
- 积分:1
-
11087 统计逆序对
说明: Description
设a[0…n-1]是一个包含n个数的数组,若在ia[j],则称(i, j)为a数组的一个逆序对(inversion)。
比如 有5个逆序对。请采用类似“合并排序算法”的分治思路以O(nlogn)的效率来实现逆序对的统计。
一个n个元素序列的逆序对个数由三部分构成:
(1)它的左半部分逆序对的个数,(2)加上右半部分逆序对的个数,(3)再加上左半部分元素大于右半部分元素的数量。
其中前两部分(1)和(2)由递归来实现。要保证算法最后效率O(nlogn),第三部分(3)应该如何实现?
此题请勿采用O(n^2)的简单枚举算法来实现。
并思考如下问题:
(1)怎样的数组含有最多的逆序对?最多的又是多少个呢?
(2)插入排序的运行时间和数组中逆序对的个数有关系吗?什么关系?
输入格式
第一行:n,表示接下来要输入n个元素,n不超过10000。
第二行:n个元素序列。
输出格式
逆序对的个数。
输入样例
5
2 3 8 6 1
输出样例
5(Set a[0... N-1] is a n array containing n numbers. If there is a [i] > a [j] i n the case of I < j, then (i, j) is a n inversion pair of a array.
For example, has five reverse pairs. Please use the idea of "merge sorting algorithm" to achieve the statistics of inverse pairs with O (nlogn) efficiency.
The number of inverse pairs of a sequence of n elements consists of three parts:
(1) The number of reverse pairs in the left half, (2) the number of reverse pairs in the right half, (3) the number of elements in the left half is greater than that in the right half.
The first two parts (1) and (2) are implemented by recursion. To ensure the final efficiency of the algorithm O (nlogn), how should the third part (3) be implemented?
Do not use O (n ^ 2) simple enumeration algorithm to solve this problem.)
- 2019-01-07 23:52:06下载
- 积分:1
-
v1
说明: 蒙特卡罗模拟算法模拟MR模型中有序无序相变(In this cpp, using a useful combined Monte Carlo algorithm, we simulate the MR model model to study the phase transition)
- 2019-07-08 21:11:07下载
- 积分:1