自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(20)
  • 收藏
  • 关注

原创 KMP

#include<stdio.h> #include<string.h> int next[105] = {0}; void get_next(char p[]){ int len = strlen(p); next[0] = -1; int j; for(j = 1; j < len; j++) { int i = ne...

2020-04-07 16:15:17 176

原创 6-2 带头结点的链式表操作集 (20分)

本题要求实现带头结点的链式表操作集。 函数接口定义: List MakeEmpty(); Position Find( List L, ElementType X ); bool Insert( List L, ElementType X, Position P ); bool Delete( List L, Position P ); 其中List结构定义如下: typedef struct...

2020-03-10 10:27:03 3668

原创 PCA与LDA

PCA: “最能代表原始数据”希望降维后的数据不能失真,也就是说,被PCA降掉的那些维度只能是那些噪声或是冗余的数据。 1:冗余,就是去除线性相关的向量(纬度),因为可以被其他向量代表,这部分信息量是多余的。 2:噪声,就是去除较小特征值对应的特征向量。 因为特征值的大小就反映了变换后在特征向量方向上变换的幅度,幅度越大,说明这个方向上的元素差异也越大,换句话说这个方向上的元素更分散。 LDA: ...

2020-03-03 10:15:19 476

原创 HDU1238 Substrings

HDU1238 Substrings 014 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1238 Problem Description You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such...

2019-08-26 20:31:20 155

原创 HDU 2752 Seek the Name, Seek the Fame(next数组的理解)

HDU 2752 Seek the Name, Seek the Fame 013 传送门:http://poj.org/problem?id=2752 Description The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat t...

2019-08-26 19:07:38 186

原创 HDU 3746 Cyclic Nacklace (最小循环节、循环周期)

HDU 3746 Cyclic Nacklace -012 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=3746 Problem Description CC always becomes very depressed at the end of this month, he has checked his credit card yesterday...

2019-08-26 16:24:31 221

原创 偶像的条件 HihoCoder - 1514

偶像的条件 HihoCoder - 1514 -011 传送门:https://vjudge.net/problem/HihoCoder-1514 小Hi的学校正面临着废校的大危机。面对学校的危机,小Hi同学们决定从ABC三个班中各挑出一名同学成为偶像。 成为偶像团体的条件之一,就是3名团员之间的身高差越小越好。 已知ABC三个班同学的身高分别是A1…AN, B1…BM 和 C1…CL。请你从中选...

2019-08-26 14:48:07 143

原创 POJ 1269 Intersecting Lines (两直线位置关系)

POJ 1269 Intersecting Lines -011 传送门:http://poj.org/problem?id=1269 Description We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect ...

2019-08-24 10:19:58 128

原创 HDU 1287 Summer Holiday

HDU 1287 Summer Holiday -010 传送门 Problem Description To see a World in a Grain of Sand And a Heaven in a Wild Flower, Hold Infinity in the palm of your hand And Eternity in an hour. —— William Blake 听...

2019-08-23 09:56:38 143

原创 POJ -2186 Popular Cows

Popular Cows 题目传送门 -009 Description Every cow’s dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ordere...

2019-08-22 17:02:06 140

原创 HDU-2112 HDU Today (map+Floyd)

HDU-2112 HDU Today -008 Problem Description 经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强。这时候,XHD夫妇也退居了二线,并在风景秀美的诸暨市浬浦镇陶姚村买了个房子,开始安度晚年了。 这样住了一段时间,徐总对当地的交通还是不太了解。有时很郁闷,想去...

2019-08-21 19:49:26 135

原创 POJ 3268 Silver Cow Party

POJ 3268 Silver Cow Party -007 Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1…N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (...

2019-08-19 20:28:45 146

原创 Sigma Function

006 1~n (n:1~10^12)中,因子和为偶数的有几个。 例如:σ(24) = 1+2+3+4+6+8+12+24=60 24的因子和即为偶数 AC代码: #include<cstdio> #include<algorithm> #include<iostream> #include<set> #include<queue> #...

2019-08-17 10:28:50 159

转载 D - Harmonic Number (II)

D - Harmonic Number (II) I was trying to solve problem ‘1234 - Harmonic Number’, I wrote the following code long long H( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) res = res + n / i...

2019-08-15 20:42:01 124

原创 HDU 1272小希的迷宫

HDU 1272小希的迷宫 005 Problem Description 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一...

2019-08-14 10:41:06 118

原创 The Suspects 并查集

The Suspects POJ1611 传送门:http://poj.org/problem?id=1611 –004 Language: The Suspects Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 58756 Accepted: 27843 Description Severe acute respira...

2019-08-13 10:47:10 153

原创 还是畅通工程(最小生成树)

还是畅通工程 --HDU 1233 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1233 –003 Problem Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小...

2019-08-13 10:33:45 123

原创 敌兵布阵 HDU-1166

敌兵布阵 HDU-1166 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1166 -002 Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某...

2019-08-10 09:46:28 145

转载 转大佬的...

以下以维护数列区间和的线段树为例,演示最基本的线段树代码。 (0)定义: #define maxn 100007 //元素总个数 #define ls l,m,rt<<1 #define rs m+1,r,rt<<1|1 int Sum[maxn<<2],Add[maxn<<2];//Sum求和,Add为懒惰标记 int A[maxn],n;//存...

2019-08-08 19:34:51 119

原创 HDU 1754 I Hate It

HDU 1754 I Hate It 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1754 -001 Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时...

2019-08-08 19:30:00 182

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除