▍1. 自然数的最大公约数
说明: 用欧几里得算法求两个自然数的最大公约数通过c语言实现(Using Euclidean Algorithms to Find the Maximum Common Number of Two Natural NumbersRealization by C Language)
说明: 用欧几里得算法求两个自然数的最大公约数通过c语言实现(Using Euclidean Algorithms to Find the Maximum Common Number of Two Natural NumbersRealization by C Language)
编程教程,帮助入门学者学习建模,从初级开始,逐步深化,非常有帮助(Programming tutorials, help beginners learn modeling, from the beginning, gradually deepen, very helpful)
说明: 编程教程,帮助入门学者学习建模,从初级开始,逐步深化,非常有帮助(Programming tutorials, help beginners learn modeling, from the beginning, gradually deepen, very helpful)
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.)
说明: 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.)
矩阵,复数自定义数据类型的C++实现,矩阵求逆采用牛顿法,(The matrix, complex number custom data type C realization, the matrix inverse uses the Newton method,)
由散点插值生成等值线,并且提供颜色选择工具,共有三种插值方法(Generating isolines from scattered interpolation and providing a color selection tool, there are three interpolation methods)
基于P-Q分解法的快速潮流计算,可用于实际系统(The fast power flow calculation based on P-Q decomposition method can be used in practical system.)
Gambit用户使用说明书(中文版), Gambit是CFD商用软件Fluent的前处理软件,主要作用是建立网格模型,其功能(Gambit user manual (Chinese version), Gambit is the pre-processing software of CFD commercial software Fluent, the main function is to build grid model, its function)
三次样条插值的C语言算法,但是总是数据溢出(Cubic spline interpolation C language algorithm, but always data overflow)
C写的填充算法源码 算法可是在编程中可是非常重要的 大家可以参考一下这个代码,学习一下算法(C padding algorithm source code algorithm but in programming is very important, you can refer to this code, learn the algorithm)
用于造波 对于从零开始学习UDF,建议还是先看一下UDF中文帮助,我估计大家知道的都是马世虎翻译的那本吧,感觉挺好。(fluent In order to learn UDF from scratch, it is suggested that we first look at UDF Chinese help.)
密度,比热,热导率,粘性系数随压力、温度变化的UDF(UDF of density, specific heat, thermal conductivity, viscosity coefficient with pressure and temperature.)
用于CFD模拟室内热舒适性,利用用户自定义编写室内热舒适评价指标PMV,对模拟分析结果进行处理,得出室内各处的PMV值。(This is used to simuate indoor thermal comfort performance through CFD.)
卡尔曼滤波的C语言实现,可用于估测电池soc等(C language implementation of Calman filter)
比较完善的面向对象的有限元程序代码,适用于编写大型程序的学习(typical C++ code for OOFEM)
经典的可编程添加模块的面向对象的有限元程序代码(C++ code for OOFEM based on multi-systems)
说明: 一维黎曼问题,一维问题,即激波管问题,是一个典型的一维可压缩无黏气体动力学问题,并有 解析解。对它采用二阶精度两步差分格式进行数值求解。(Riemann problem, One dimensional problem, the shock tube problem, is a typical one-dimensional compressible non viscous gas dynamic problem with analytic solutions. It is solved numerically by two order two step difference scheme.)