数学||算法
文章平均质量分 70
lovelyloulou
Computer Vision,machine learning,Computer Graphics
展开
-
GSL计算逆矩阵
void GetInverse(gsl_matrix *A, gsl_matrix *inverse){ int n = A->size1; gsl_matrix *tmpA = gsl_matrix_alloc(n, n); gsl_matrix_memcpy(tmpA, A); gsl_permutation *p = gsl_permutation_alloc(n); int s原创 2012-09-21 03:27:16 · 4476 阅读 · 6 评论 -
(ZJU-2006复试)-HDOJ-1237-简单计算器
简单计算器Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3765 Accepted Submission(s): 1231Problem Description读入一个只包含 +, -, *, / 的非负整数原创 2010-02-03 15:50:00 · 855 阅读 · 1 评论 -
(ZJU-2006复试)-HDOJ-1235-统计同成绩学生人数
统计同成绩学生人数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4399 Accepted Submission(s): 2543Problem Description读入N名学生的成绩,将获得某一给定分数的学生人数原创 2010-02-03 12:08:00 · 997 阅读 · 0 评论 -
(ZJU-2008复试)-HDOJ-1878-欧拉回路
欧拉回路Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3122 Accepted Submission(s): 1030Problem Description欧拉回路是指不令笔离开纸面,可画过图中每条边仅一次,且可以原创 2010-02-06 11:54:00 · 818 阅读 · 1 评论 -
(ZJU-2007复试)-HDOJ-1864-最大报销额(DP OR 搜索)
最大报销额Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4600 Accepted Submission(s): 1027Problem Description现有一笔经费可以报销一定额度的发票。允许报销的发票类原创 2010-02-04 18:43:00 · 1444 阅读 · 0 评论 -
(ZJU-2007复试)-HDOJ-1859-最小长方形
最小长方形Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2758 Accepted Submission(s): 1507Problem Description给定一系列2维平面点的坐标(x, y),其中x和y均为原创 2010-02-04 11:20:00 · 590 阅读 · 0 评论 -
(ZJU-2006复试)-ZOJ-2529-A+B in Hogwarts
A+B in HogwartsTime Limit: 1 Second Memory Limit: 32768 KBIf you are a fan of Harry Potter, you would know the school he is attending to, the Hogwarts School for Witchcraft and Wizardr原创 2010-02-02 23:11:00 · 877 阅读 · 0 评论 -
(ZJU-2006复试)-ZOJ-1006-Do the Untwist
Do the UntwistTime Limit: 1 Second Memory Limit: 32768 KBCryptography deals with methods of secret communication that transform a message (the plaintext) into a disguised form (the原创 2010-02-02 15:36:00 · 909 阅读 · 0 评论 -
(ZJU-2005复试)-HDOJ-1236-排名
排名Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4193 Accepted Submission(s): 1517Problem Description今天的上机考试虽然有实时的Ranklist,但上面的排名原创 2010-02-02 14:06:00 · 1165 阅读 · 0 评论 -
(ZJU-2005复试)-HDOJ-1234-开门人和关门人
开门人和关门人Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3157 Accepted Submission(s): 1584Problem Description每天第一个到机房的人要把门打开,最后一个离开的原创 2010-02-02 14:00:00 · 988 阅读 · 0 评论 -
(ZJU-2005复试)-HDOJ-1232-畅通工程
畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5813 Accepted Submission(s): 2867Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列原创 2010-02-02 13:58:00 · 836 阅读 · 1 评论 -
(ZJU-2005复试)-HDOJ-1231-最大连续子序列
最大连续子序列Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4402 Accepted Submission(s): 1681Problem Description给定K个整数的序列{ N1, N2, ...,原创 2010-02-02 13:54:00 · 994 阅读 · 1 评论 -
(ZJU-2007复试)-HDOJ-1862-EXCEL排序
EXCEL排序Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4137 Accepted Submission(s): 1253Problem DescriptionExcel可以对一组纪录按任意指定列排序。原创 2010-02-04 12:40:00 · 801 阅读 · 0 评论 -
(ZJU-2007复试)-HDOJ-1863-畅通工程(又来了)
畅通工程Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4050 Accepted Submission(s): 1523Problem Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公原创 2010-02-04 12:54:00 · 620 阅读 · 0 评论 -
(ZJU-2007复试)-HDOJ-1861-游船出租
游船出租Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3391 Accepted Submission(s): 1126Problem Description现有公园游船租赁处请你编写一个租船管理系统。当游客租船时原创 2010-02-04 12:04:00 · 830 阅读 · 0 评论 -
GSL计算矩阵的行列式值
double get_det(gsl_matrix * A) { double det=0.0; int n = A->size1; gsl_permutation *p = gsl_permutation_calloc(n); gsl_matrix *tmpA = gsl_matrix_calloc(n, n); int signum; gsl_matrix_memc原创 2012-09-21 03:21:53 · 2371 阅读 · 0 评论 -
Mahalanobis Distance (马氏距离)
与欧式距离不同的是马氏距离考虑到各种特性之间的联 系(例如:一条关于身高的信息会带来一条关于体重的信息,因为两者是有关联的),并且是尺度无关的(scale-invariant),即独立于测量尺 度。在计算欧氏距离的根号内多除以一个协方差矩阵我的理解是,若考虑各包含n个特征变量的两个特征向量v1,v2,要计算它们的距离,即相似度如果向量中的特征变量所采用的尺度单位不同,则会造成各变量集的方差不同这时候数据所在的空间就像被拉伸扭曲了,比如对二维而言,横轴用厘米,数轴用千米。对于点(1,1)而言,原创 2011-04-21 21:59:00 · 10039 阅读 · 0 评论 -
ZOJ-1082-Stockbroker Grapevine(最短路径)
Stockbroker GrapevineTime Limit: 1 Second Memory Limit: 32768 KB Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformat原创 2010-03-15 00:20:00 · 783 阅读 · 0 评论 -
ZOJ-1084-Channel Allocation(DFS)
Channel AllocationTime Limit: 1 Second Memory Limit: 32768 KBWhen a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every r原创 2010-03-13 23:53:00 · 2145 阅读 · 0 评论 -
ZOJ-1285-Shipping Routes(最短路径)
Shipping RoutesTime Limit: 1 Second Memory Limit: 32768 KBThe Slow Boat to China Shipping company needs a program to help them quickly quote costs to prospective customers. The cost of原创 2010-03-13 21:22:00 · 1201 阅读 · 0 评论 -
ZOJ-1090-The Circumference of the Circle(计算几何,海伦公式,三角形外接圆半径公式,cout输出小数的一些问题)
The Circumference of the CircleTime Limit: 1 Second Memory Limit: 32768 KBTo calculate the circumference of a circle seems to be an easy task - provided you know its diameter. But what if原创 2010-03-11 23:41:00 · 4125 阅读 · 0 评论 -
ZOJ-1003-Crashing Balloon(搜索)
Crashing BalloonTime Limit: 1 Second Memory Limit: 32768 KBOn every June 1st, the Childrens Day, there will be a game named "crashing balloon" on TV. The rule is very simple.原创 2010-02-24 13:15:00 · 3442 阅读 · 2 评论 -
(ZJU-2008复试)-HDOJ-1881-毕业bg(DP)
毕业bgTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2015 Accepted Submission(s): 741Problem Description每年毕业的季节都会有大量毕业生发起狂欢,好朋友们相约吃散伙原创 2010-02-12 00:59:00 · 2121 阅读 · 3 评论 -
(ZJU-2008复试)-HDOJ-1880-魔咒词典
魔咒词典Time Limit: 8000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3897 Accepted Submission(s): 973Problem Description哈利波特在魔法学校的必修课之一就是学习魔咒。据说魔法世界有原创 2010-02-07 19:26:00 · 1482 阅读 · 3 评论 -
(ZJU-2008复试)-HDOJ-1877-又一版 A+B
又一版 A+BTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4664 Accepted Submission(s): 1683Problem Description输入两个不超过整型定义的非负10进制整数A和B(31原创 2010-02-06 11:53:00 · 1058 阅读 · 0 评论 -
(ZJU-2006复试)-HDOJ-1233-还是畅通工程
还是畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4404 Accepted Submission(s): 2099Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间原创 2010-02-03 11:57:00 · 771 阅读 · 0 评论 -
POJ-1011-Sticks(经典搜索)
SticksTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 62343 Accepted: 13658DescriptionGeorge took sticks of the same length and cut them randomly until原创 2010-01-31 18:27:00 · 2201 阅读 · 0 评论 -
(ZJU-2005复试)-HDOJ-1180-Self Numbers
Self Numbers Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1927 Accepted Submission(s): 828 Problem DescriptionIn 1949原创 2010-01-27 14:55:00 · 1106 阅读 · 0 评论 -
HDOJ-1597find the nth digit
find the nth digitTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2226 Accepted Submission(s): 603Problem Description假设:S1 = 1S2 = 12原创 2010-01-24 19:00:00 · 1526 阅读 · 0 评论 -
ZOJ-1984 Genetic Code(搜索)
ZOJ Problem Set - 1984Genetic CodeTime Limit: 5 Seconds Memory Limit: 32768 KB Special Judge The connections between mathematics and biology are complicated. Most of the time they原创 2009-06-02 17:10:00 · 1019 阅读 · 0 评论 -
ZOJ-1937 Addition Chains(迭代搜索)
/*1937Addition Chains--------------------------------------------------------------------------------Time Limit: 1 Second Memory Limit: 32768 KB Special Judge -------------------------原创 2009-06-01 22:08:00 · 1829 阅读 · 2 评论 -
ZOJ-1457Prime Ring Problem(搜索)
Prime Ring Problem--------------------------------------------------------------------------------Time Limit: 10 Seconds Memory Limit: 32768 KB ---------------------------------------------原创 2009-05-28 01:35:00 · 599 阅读 · 0 评论 -
ZOJ2412Farm Irrigation
Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these squares. Different square has a different type of原创 2009-05-22 22:52:00 · 531 阅读 · 0 评论 -
ZOJ 1711 Sum It Up
/*Sum It Up--------------------------------------------------------------------------------Time Limit: 1 Second Memory Limit: 32768 KB ------------------------------------------------------原创 2009-05-21 12:42:00 · 872 阅读 · 0 评论 -
怎样不输出小数后面的0?
做题的时候遇到个问题,就是不要输出小数后的0, 查了一下,大家都说把浮点数转化成字符串,再去掉零。。太恐怖了,为什么不直接用cout呢, cout是不会输出小数后的0的。。。。我无语了原创 2009-05-20 12:59:00 · 2230 阅读 · 2 评论 -
1056The Worm Turns
/*ZOJ Problem Set - 1056The Worm Turns--------------------------------------------------------------------------------Time Limit: 1 Second Memory Limit: 32768 KB ---------------------------原创 2009-05-08 23:29:00 · 1122 阅读 · 0 评论 -
ZOJ Problem Set - 1088System Overload
/*ZOJ Problem Set - 1088System Overload--------------------------------------------------------------------------------Time Limit: 10 Seconds Memory Limit: 32768 KB ------------------------原创 2009-05-10 01:57:00 · 919 阅读 · 0 评论 -
一些计算几何
1)向量的外积 计算矢量叉积是与直线和线段相关算法的核心部分。设矢量P = ( x1, y1 ),Q = ( x2, y2 ),则矢量叉积定义为由(0,0)、p1、p2和p1+p2所组成的平行四边形的带符号的面积,即:P × Q = x1*y2 - x2*y1,其结果是一个标量。显然有性质 P × Q = - ( Q × P ) 和 P × ( - Q ) = - ( P × Q )。转载 2009-05-04 23:23:00 · 505 阅读 · 0 评论 -
zju 1025
/*zju 1025Wooden Sticks--------------------------------------------------------------------------------Time limit: 1 Seconds Memory limit: 32768K Total Submit: 6016 Accepted Submit: 1959原创 2009-04-26 20:00:00 · 601 阅读 · 0 评论 -
1067 Color Me Less
#include #include using namespace std;double target[48];int main(){ double r,g,b; for(int i=0;i { cin>>r>>g>>b; target[i]=r; target[i+1]=g;原创 2009-04-10 00:16:00 · 453 阅读 · 0 评论