-
PR_midugen
P-R方程编程源代码,用于热力学相平衡计算,计算泡点和露点,欢迎大家下载!(PR equation programming source code, used to calculate the thermodynamic equilibrium, the bubble point and dew point calculation, welcome to download!)
- 2021-02-28 16:59:35下载
- 积分:1
-
jiheraoshelilun
几何绕射理论,是高频解决电磁场问题的方法,本书很具有代表性(GTD is a high-frequency electromagnetic fields to solve the problem, this book is a representative)
- 2008-04-24 12:07:21下载
- 积分:1
-
shuzhifenxi
分数值分析的一些ppt课件,很有用,在学习C的时候,可以用到这些博大精深的思想(Fractional value analysis ppt courseware, useful when learning C, you can use these profound thought)
- 2013-05-21 16:04:39下载
- 积分:1
-
FFT842
基二、基四、基八 FFT变化源代码,有详细注解(Second base, the base four or eight FFT-based changes in the source code, detailed comments)
- 2021-02-20 14:09:43下载
- 积分:1
-
11087 统计逆序对
Description
设a[0…n-1]是一个包含n个数的数组,若在i<j的情况下,有a[i]>a[j],则称(i, j)为a数组的一个逆序对(inversion)。
比如 <2,3,8,6,1> 有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, <2,3,8,6,1> 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
-
SHUZHIFENXI
牛顿迭代法,用于求解非线性方程,具体使用方法见程序内部说明。(Newton iteration for solving nonlinear equations, the specific use of the procedure see the internal note.)
- 2007-11-05 09:01:46下载
- 积分:1
-
equation
线性方程组的计算,采用的是高斯消元法来实现的。只有主要的算法代码,没有写主函数(Calculation of linear equations using the Gauss elimination method to achieve. Only the main algorithm code, did not write the main function)
- 2010-08-05 19:34:04下载
- 积分:1
-
LAPACK-3.4.1.tar
LAPACK,其名為Linear Algebra PACKage的縮寫,是一以Fortran程式語言寫就,用於數值計算的函式集。 LAPACK提供了豐富的工具函式,可用於諸如解多元線性方程式、線性系統方程組的最小平方解、計算特徵向量、用於計算矩陣QR分解的Householder轉換、以及奇異值分解等問題。(LAPACK (Linear Algebra PACKage) is a software library for numerical linear algebra. It provides routines for solving systems of linear equations and linear least squares, eigenvalue problems, and singular value decomposition. It also includes routines to implement the associated matrix factorizations such as LU, QR, Cholesky and Schur decomposition.)
- 2012-07-31 10:14:37下载
- 积分:1
-
bianchengzhuji
编程珠玑有一条项链,它由 N 个随机排列的红、白和蓝色的珠子组成(3< =N< =350(Abas programming there is a necklace, which consists of N random with red, white and blue components of the beads (3 < = N < = 350)
- 2016-02-15 06:45:37下载
- 积分:1
-
picture
计算数码照片植被覆盖度。包括照片裁剪,RGB2HSL和计算(compute the vegetaion cover of digital image.)
- 2012-06-23 14:46:40下载
- 积分:1