Location:
Search - n2-1
Search list
Description: 重排九宫是一个古老的单人智力游戏。据说重排九宫起源于我国古时由三国演义故事
“关羽义释曹操”而设计的智力玩具“华容道”,后来流传到欧洲,将人物变成数字。原始
的重排九宫问题是这样的:将数字1~8按照任意次序排在3´ 3 的方格阵列中,留下一个空
格。与空格相邻的数字,允许从上,下,左,右方向移动到空格中。游戏的最终目标是通过
合法移动,将数字1~8 按行排好序。在一般情况下,重排n2宫问题是将数字1~n2-1 按照
任意次序排在n´ n的方格阵列中,留下一个空格。允许与空格相邻的数字从上,下,左,右
4 个方向移动到空格中。游戏的最终目标是通过合法移动,将初始状态变换到目标状态。
Platform: |
Size: 9769 |
Author: BOBO |
Hits:
Description: 求N皇后问题的一个解:
算法 :QS1
Platform: |
Size: 1240 |
Author: abraham |
Hits:
Description: 矩阵的压缩存储 问题描述:矩阵是许多科学与工程计算问题中出现的数学对象。在此,我们感兴趣的不是矩阵本身,我们所关心的是研究表示矩阵的方法,以使对矩阵的各种运算能有效地完成。一个矩阵一般由m行和n列元素组成,一般的m*n阶矩阵,可表示成一个m*n的二维数组,例如matrix[m][n],需要的存储空间是m*n 实现要求: 若矩阵中的元素是对称的,即矩阵中第i行第j列与第j行第i列元素的值相等,即matrix[i][j]=matrix[j][i],我们把这种矩阵称为对称矩阵。对于n*n阶对称矩阵,我们可以为每一对对称元素分配一个存储空间,即只需要存储其下三角(包括对角线)或上三角中的元素即可。这样,就可将n2个元素压缩存储到n(n+1)/2个存储单元中。请实现该功能 当一个n*n阶矩阵的主对角线上方或下方的所有元素皆为零时,称该矩阵为三角矩阵。对于三角矩阵,我们同样也可采用对称矩阵的压缩存储方式将其上三角或下三角的元素存储在一维数组中,达到节约存储空间的目的。请实现该功能 除了对称矩阵和三角矩阵等特殊矩阵外,在实际应用中我们还经常遇到这样一类矩阵,存储在矩阵中的大量元素值为零,而且零元素的分布没有规律,这样的矩阵称为稀疏矩阵。对于稀疏矩阵,采用二维数组表示既浪费大量的存储单元来存储零元素,又要花大量的时间进行零元素的运算。为此,我们对稀疏矩阵采取三元组法进行存储。请实现该功能
Platform: |
Size: 304178 |
Author: runonce |
Hits:
Description: 对链表进行排序,时间复杂度O(n2),类似于插入排序的思想-right sort, time complexity O (n2), similar to the sequencing of the insert thinking
Platform: |
Size: 163840 |
Author: 苗建新 |
Hits:
Description: 重排九宫是一个古老的单人智力游戏。据说重排九宫起源于我国古时由三国演义故事
“关羽义释曹操”而设计的智力玩具“华容道”,后来流传到欧洲,将人物变成数字。原始
的重排九宫问题是这样的:将数字1~8按照任意次序排在3´ 3 的方格阵列中,留下一个空
格。与空格相邻的数字,允许从上,下,左,右方向移动到空格中。游戏的最终目标是通过
合法移动,将数字1~8 按行排好序。在一般情况下,重排n2宫问题是将数字1~n2-1 按照
任意次序排在n´ n的方格阵列中,留下一个空格。允许与空格相邻的数字从上,下,左,右
4 个方向移动到空格中。游戏的最终目标是通过合法移动,将初始状态变换到目标状态。
Platform: |
Size: 1033216 |
Author: |
Hits:
Description: 最小生成树Prim算法的实现,时间复杂度O(n2)-Prim minimum spanning tree algorithm, time complexity O (n2)
Platform: |
Size: 6144 |
Author: 赵仕济 |
Hits:
Description: Windows MFC编程,实现了MFC绘图功能
1、单击鼠标右键可以选择绘制直线、椭圆、矩形或停止绘图\n2、绘制的图像可以保存或打开曾经保存过的图像\n3、单击工具栏的开始按钮可以开始播放动画,单击停止按钮可以暂停播放动画-Windows MFC Programming, MFC drawing functions realize a one, click the right mouse button can choose to draw a straight line, oval, rectangular or stop mapping 2, mapping the image can be saved or opened that have saved the image 3, click the beginning of the toolbar button to start playback animation, click the stop button to pause animation
Platform: |
Size: 713728 |
Author: zc |
Hits:
Description: 读取BMP 8bit文件(size n1*n2),输出整个文件[n1]*[n2]的像素值,像素值的范围0-255,并统计每个像素质的数量-BMP 8bit file read (size n1* n2), the output document as a whole [n1]* [n2] the pixel value, pixel value range of 0-255, and the quality of statistics like the number of each
Platform: |
Size: 443392 |
Author: cao |
Hits:
Description: C2:插值
1 拉格朗日插值(POLINT)
2 有理函数插值(RATINT)
3 三次样条插值(SPLINE(二阶导数值)->SPLINT(函数值))
4 有序表的检索法(LOCATE(二分法), HUNT(关联法))
5 插值多项式(POLCOE(n2), POLCOF(n3))
6 二元拉格朗日插值(POLIN2)
7 双三次样条插值(SPLIE2)-C2: 1 Lagrange interpolation interpolation (POLINT) 2 rational function interpolation (RATINT) 3 Cubic Spline Interpolation (SPLINE (second derivative value)-> SPLINT (function value)) 4 sorted list of search method (LOCATE ( dichotomy), HUNT (correlation method)) 5 interpolation polynomial (POLCOE (n2), POLCOF (n3)) 6 dual Lagrange interpolation (POLIN2) 7 bicubic spline interpolation (SPLIE2)
Platform: |
Size: 31744 |
Author: 王斌 |
Hits:
Description: n2-1谜问题, n2-1谜问题 ,-n2-1 mystery problem, n2-1 mystery problem, n2-1 n2-1 mystery mystery problem issues
Platform: |
Size: 1024 |
Author: shi |
Hits:
Description: 重排九宫是一个古老的单人智力游戏。据说重排九宫起源于我国古时由三国演义故事“关羽义释曹操”而设计的智力玩具“华容道”,后来流传到欧洲,将人物变成 数字。原始的重排九宫问题是这样的:将数字1~8按照任意次序排在3×3的方格阵列中,留下一个空格。与空格相邻的数字,允许从上,下,左,右方向移动到 空格中。游戏的最终目标是通过合法移动,将数字 1~8 按行排好序。在一般情况下,n2-1 谜问题是将数字 1~n2-1 按照任意次序排在n×n的方格阵列中,留下一个空格。允许与空格相邻的数字从上,下,左,右 4个方向移动到空格中。游戏的最终目标是通过合法移动,将初始状态变换到目标状态。
对于给定的n×n方格阵列中数字1~n2-1 初始排列,编程计算将初始排列通过合法移动变换为目标状态最少移动次数。
′数据输入:
文件的第1行有1个正整数n。以下的n行是 n×n方格阵列的中数字1~n2-1的初始排列,每行有n个数字表示该行方格中的数字, 0表示空格。
接着n行是n×n方 格阵列的中数字1~n2-1的目标排列,每行有n个数字表示该行方格中的数字, 0表示空格。1<=n<=10
结果输出:
第 1 行是最少移动次数。-Rearrangement Jiu Gong is an ancient single puzzle. Jiu Gong is said to originate from the rearrangement of China in ancient times by the Three Kingdoms story, "Guan Yu Yi Cao release" designed to intellectual toys "Huarong" and later spread to Europe, will figure into a figure. Jiugong original rearrangement problem is this: will the number 1 to 8 in accordance with any order of ranking, the box in the 3 × 3 array, leaving a space. And the number of adjacent spaces, to allow from the top, bottom, left and right direction to move to the space. The ultimate goal of the game through the legal move, the numbers 1 to 8 lined by row sequence. Under normal circumstances, n2-1 mystery issue is the number 1 ~ n2-1 in accordance with any order of rank n × n array of squares, leaving a space. Permitted number of adjacent spaces from the top, bottom, left and right four directions to move to an empty cell. The ultimate goal of the game through the legal move, transform the initial state to target
Platform: |
Size: 883712 |
Author: wakaka |
Hits:
Description: InjectorDll 线程注入程序第一个参数:运行的目标程序\n第二个参数:你的模块\n2.例如:郭荣华.exe winlogon.exa,C:\\NoShutDLL.dll"
可以把您的模块注入正在运行的进程中-InjectorDll thread into the program the first argument: to run the target program \ n the second argument: your module \ n2. For example: Guo Ronghua. Exe winlogon.exa, C: \ \ NoShutDLL.dll " can put your modules into being running process
Platform: |
Size: 962560 |
Author: 郭荣华 |
Hits:
Description: 学习vc的简单应用,对于初学者有很大的帮助,希望朋友们下载看看。-Simple application of learning vc, very helpful for beginners, I hope you will download to see.
Platform: |
Size: 2064384 |
Author: zhuxiaolei |
Hits:
Description: 15 - puzzle: The computer will move the boxes in turn, each time a cell next to the box, so that after a finite number of steps will move the source table on the destination table.
Platform: |
Size: 2552832 |
Author: Tinnyginatic |
Hits:
Description: 编写螺旋方阵。其中螺旋方阵形式如下:
1 12 11 10
2 13 16 9
3 14 15 8
4 5 6 7
设row,column分别代表行、列坐标,变量p从1到n2将p依次存入数组a[row][column]中,要确定row、colomn的变化情况。分析如下:引进变量k,初值为n。当数据存入到左下角或右上角时,k减1,这样可保证输出时方阵。引进变量t,初值为1,当数据存入到右下角时,令t改变符合,当存入到左上角时,t又改变符合,这样可保证赋值到正确的数组坐标。
-Write spiral square. Square spiral form which is as follows: 1 12 1,110,213,169,314,158,456 7 set row, column representing the row, column coordinates, the variable p p from 1 to n2 will turn into an array a [row] [column], we must determine the row, colomn changes. As follows: the introduction of variable k, the initial value is n. When the data stored in the lower left or upper right corner when, k by 1, it will ensure that the output matrix. The introduction of variable t, the initial value is 1, when the data stored in the lower right corner, have resulted in changes consistent with t, the time when the deposit to the upper left corner, t and changing the match, it will ensure that the correct assignment to the array of coordinates.
Platform: |
Size: 10240 |
Author: 王一帆 |
Hits:
Description: 约瑟夫环,设有n个人围坐在一个圆桌周围,现从第s个人开始报数,数到第m的人出列,然后从出列的下一个人重新开始报数,数到第m的人又出列,…,如此反复直到所有的人全部出列为止。以n=8,s=1,m=4为例,若初始的顺序为 n1,n2,n3,n4,n5,n6,n7,n8。则问题的解为n4,n8,n5,n2,n1,n3,n7,n6。-Joseph Wan, with n individuals sitting around a round table, is reported starting from the number of individuals s, m the number of people to the column and the column from the next person to start reporting the number of numbers to m, who has a column, ..., and so forth until all the people all of the column so far. To n = 8, s = 1, m = 4, for example, if the initial order of n1, n2, n3, n4, n5, n6, n7, n8. The solution of the problem n4, n8, n5, n2, n1, n3, n7, n6.
Platform: |
Size: 190464 |
Author: ll |
Hits:
Description: Otsu算法步骤如下:
设图象包含L个灰度级(0,1…,L-1),灰度值为i的的象素点数为Ni ,图象总的象素点数为N=N0+N1+...+N(L-1)。灰度值为i的点的概率为:
P(i) = N(i)/N.
门限t将整幅图象分为暗区c1和亮区c2两类,则类间方差σ是t的函数:
σ=a1*a2(u1-u2)^2 (2)
式中,aj 为类cj的面积与图象总面积之比,a1 = sum(P(i)) i->t, a2 = 1-a1 uj为类cj的均值,u1 = sum(i*P(i))/a1 0->t,
u2 = sum(i*P(i))/a2, t+1->L-1
该法选择最佳门限t^ 使类间方差最大,即:
令Δu=u1-u2,σb = max{a1(t)*a2(t)Δu^2}-int otsu (IplImage*image, int rows, int cols, int x0, int y0, int dx, int dy, int vvv)
{
unsigned char*np // 图像指针
int thresholdValue=1 // 阈值
int ihist[256] // 图像直方图,256个点
int i, j, k // various counters
int n, n1, n2, gmin, gmax
double m1, m2, sum, csum, fmax, sb
·····
Platform: |
Size: 1549312 |
Author: 燕子一舞 |
Hits:
Description: 背景
从前,有一个古老的帝国有两个形状不同的塔分别在不同的两个城市里。这两个塔是用圆形的砖一块一块建成的。这些圆形砖的高度是一样的,其半径都是整数。很明显,尽管这两个塔形状不同,但造塔所使用的圆形砖却有很多是相同的。
过了很多年,一个国王命令他的建筑师们移除两个塔的部分砖以便使它们的形状完全一样,同时使两个塔的高度尽可能的高,并且新塔的砖瓦的排列顺序必须与原来的一样。国王认为这样的两个塔象征着这两个城市之间的和谐和平等,于是命名它们为双胞胎塔。
任务
现在,两千年以后,你可以来处理这样非常简单的问题:给你两个不同形状塔的描述,你只要算出能建成的新双塔的最多的砖瓦数。
输入
输入包括以下内容:第一行输入两个整数 N1 和 N2 (1 <= N1,N2 <= 100) 分别表示最初时两个塔的砖瓦数;第二行输入 N1 个正整数表示第一个塔砖瓦的半径(按从上到下的顺序排列);下面的一行输入 N2 个整数表示第二个塔砖瓦的半径(按从上到下的顺序排列)。
当输入的 N1 和 N2 为 0 时结束。
输出
输出建成的新双塔的最多的砖瓦数。-Background
There was once an ancient empire with two different shapes of the two towers at different cities . The two circular brick tower is built piece by piece . These circular brick height is the same, the radius are integers. Clearly, although both towers of different shapes , but making use of the circular tower there are many tiles are identical .
Over many years, a king ordered his architects to remove two brick towers in order to make them part of exactly the same shape , but the height of the two towers as high as possible , and the new order of brick tower must be the same as the original . Kings think this two tower symbolizes the harmony between the two cities and equality , so named them as twin towers.
Task
Now, two years later, you can come to deal with this very simple question : give you a description of two towers of different shapes , as long as you can calculate the new towers built up brick number.
Enter
Inputs include the following: The first line of
Platform: |
Size: 1503232 |
Author: kenber |
Hits:
Description: 根据温度压力计算N2的偏差系数、密度等参数-N2 coefficient of variation is calculated, the density and other parameters according to the temperature and pressure
Platform: |
Size: 214016 |
Author: 陈林 |
Hits: