自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 HDU 5365(计算几何)

RunTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 101Accepted Submission(s): 43Problem DescriptionAFA is a girl who like runing....

2015-08-08 23:24:00 148

转载 2015 Multi-University Training Contest 1 题解 BY ME

多校第一场结束了,先来没事整理了一下代码http://blog.sina.com.cn/s/blog_15139f1a10102vnx5.html (这是题解,没有代码的题解)下面是我根据题解写出的代码第一题 hdu 5288OO’s Sequence#include <map>#include <set>#include &lt...

2015-07-22 23:42:00 108

转载 HDU 1556

#include <map>#include <set>#include <list>#include <stack>#include <queue>#include <cmath>#include <ctime>#include <cstdio>#incl...

2015-04-04 21:39:00 114

转载 POJ 2352 Stars

// 树状数组#include <map>#include <set>#include <list>#include <stack>#include <queue>#include <cmath>#include <ctime>#include <cstdio&g...

2015-04-04 21:39:00 132

转载 POJ 2155

楼教主的题,很不错的二维树状数组#include <map>#include <set>#include <list>#include <stack>#include <queue>#include <cmath>#include <ctime>#include &lt...

2015-04-04 21:39:00 129

转载 离散化

vector <PINT> V;int N;int a[MAXN];int x;int main () { cin >> N; REP(i,N) { cin >> x; V.push_back(make_pair(x,i)); } sort(V.begin(),V.end()); REP(i,N) a...

2015-03-04 18:10:00 106

转载 线段树学习总结

本篇博客会持续跟新。。。。。线段树1.概念  线段树是一种完全二叉树,与区间树相似,它将一个区间划分成一些单元区间,每个单元区间分别对应着线段树中的一个叶节点。主要用于区间的动态查询问题,每次操作的复杂度为O(logn)。2.性质  如果父亲节点表示区间[a,b],那么左儿子表示的区间为[a,(a + b) / 2],右儿子[(a + b) / 2 + 1,b]。...

2015-03-04 15:01:00 107

转载 520C DNA Alignment

C. DNA Alignmenttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya became interested in bioinformatics. He...

2015-03-02 18:25:00 110

转载 Codeforces 519D A and B and Interesting Substrings

D. A and B and Interesting Substringstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA and B are preparing th...

2015-03-01 09:08:00 102

转载 hihoCoder #1050 : 树中的最长路

写这篇博客的目的有两个1.总结一下自己的心得,以免后来会忘掉。2.搜了好多别人的博客,好多都是模棱两可,比如在说明 u 不是直径上的点的时候,随便说了一下 u 的最长路 一定与直径相交,并没有说明为什么,借此机会,我就说明一下。树的直径(树的最长路)下面是定理和证明:定理:  从树的任意一点 u 出发,DFS 到最长路终点 s,再从 s 点 DFS 到最长路的终点...

2015-02-28 17:24:00 74

转载 动态规划起步(状态压缩) hihoCoder

题目解释的很清楚了,不多说#1044 : 状态压缩·一时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho在兑换到了喜欢的奖品之后,便继续起了他们的美国之行,思来想去,他们决定乘坐火车前往下一座城市——那座城市即将举行美食节!但是不幸的是,小Hi和小Ho并没有能够买到很好的火车票——他们只...

2015-02-27 16:26:00 136

转载 hihocoder 举行判断(计算几何)

判断是否为矩形,必须满足相异的4个点,存在4条边(不重合),边的向量只有两个,且两向量垂直;满足这些条件就可以了小知识点:  两个向量垂直(x1,y1),(x2,y2) x1 * x2 + y1 * y2 == 0;  两个向量平行(x1,y2),(x2,y2) x1 * y2 - x2 * y2 == 0;#1040 : 矩形判断...

2015-02-25 16:57:00 126

转载 manacher 算法 O(n)最长回文子串

1 #include <map> 2 #include <set> 3 #include <list> 4 #include <stack> 5 #include <queue> 6 #include <cmath> 7 #include <ctime> 8 #inclu...

2015-02-24 21:39:00 90

转载 Tries 树

head 头指针#include <map>#include <set>#include <list>#include <stack>#include <queue>#include <cmath>#include <ctime>#include <cstdio&...

2015-02-24 10:11:00 186

转载 uva 1626(动态规划起步第五天 LIS变形 括号匹配)

挺简单的先谈状态 dp[i][j]表示i---j之间的最少需要加的括号数再谈转移 if S 为 合法序列 那么 (S),[S] 都为合法序列,那么dp[i][j] = dp[i +1][j - 1];if A 为合法序列 && B为合法序列 那么 AB 为合法序列 dp[i][j] = dp[i][k] + dp[k + 1][j];所以代码...

2015-02-21 14:38:00 113

转载 uva 10003(动态规划起步第四天 矩阵连乘)

类似矩阵连乘的一道题,很简单DP[i][j]表示区间i,j最少费用,状态转移为DP[i][j] = min{DP[i][k],DP[k][j]} + a[j] - a[i]; 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include &lt...

2015-02-17 18:32:00 83

转载 uva 11584(动态规划起步第四天 线性DP)

题目很容易,找到状态DP[i] 表示前 i 个字符中最少的划分,那么转移DP[i] = min {DP[j] + 1 | s[j +1]...s[i] 为 palindromes} 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include ...

2015-02-17 15:16:00 104

转载 uva 11400 (动态规划起步第四天 线性DP)

题目很简单,LIS变形 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <set> 5 #include <algorithm> 6 7 #define REP(i,N) for (int i =...

2015-02-17 13:32:00 104

转载 uva 12563(动态规划起步第三天 01背包变形)

谈到背包,大家肯定都熟悉,我就不多讲,而这题挺有意思。DP[i][j] 表示前 i 首歌在j时间内唱的最多曲目;状态有了,那么怎么转移呢? DP[i][j] = max{DP[i - 1][j],DP[i - 1][j - t[i]] + 1};但是此题还有时间。所以如果初始化为0的话,按照平常背包的代码,很难求出最长时间。所以我们初始化为-1,且-1时不计算,那么这就避免了...

2015-02-15 20:50:00 110

转载 uva 116(动态规划起步第三天 DAG)

一道比较简单的动态规划的题,求从第一列的任何位置 到达最后一列 和的最小值。所以这个状态可以是 列,在每一列有三种决策,直行,右上,右下。DP[i][j] 表示在第i行,j列到达最后一列的最小支出。那么有了状态,我们可以进行转移,DP[i][j] = min{DP[i + 1][j + 1],DP[i][j + 1],DP[i - 1][j + 1]} + a[i][j];(跟数...

2015-02-15 17:26:00 71

转载 uva 437 ( 动态规划起步第二天 DAG)

由于事情的耽误,导致第二天出来的有点慢,今天是我学动态规划的第二天,做了一个DAG上的最长路。一个立方体的高有三个,然后判断个点之间是否可以连接,然后DAG搞定#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#de...

2015-02-13 19:20:00 106

转载 UVA 1025( 动态规划起步第一天)

2015年2月11日,我开始了我的DP之路,也不知道能不能掌握,只能一点点的积累了。这是我的第一题UVA1025 (A Spy in the Metro);题目的意思很清楚了,当你在一个汽车站的时候,你之后两种选择,一是等着,二是上车(前提有车),当然有车的时候也可以不做,无所谓;当然有车,也要看方向。决定状态的量是某个时刻你再某个位置。DP[i][j]即 i 时刻, 你在...

2015-02-11 17:54:00 112

转载 uva 1606 (计算几何)

这是我人生中的第一个计算几何题,好好收藏一下。1、当一个点关于远点对称之后,除了两点之间的连线外,其他的任何直线都会讲两点分成两个部分2、极角排序3、线的旋转4、叉积求 sin#include <iostream>#include <cstdio>#include <cmath>#include <algori...

2015-02-09 10:29:00 132

转载 Hash_map

struct Hash_map { static const int mask=0x7fffff; int p[8388608],q[8388608]; void clear() { for(int i=0; i<=mask; ++i) q[i]=0; ...

2015-02-07 15:57:00 58

转载 关节点算法

1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <vector> 5 6 using namespace std; 7 #define MAXN 1000 8 int low[MAXN],visit[MAX...

2015-01-03 15:52:00 356

转载 平衡二叉树

1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <vector> 5 6 using namespace std; 7 8 template <typename E> clas...

2015-01-01 16:48:00 78

转载 Apache与PHP整合

在conf/httpd.conf里添加LoadModule php5_module "C:/MyPHP/php/php5apache2_2.dll" PHPIniDir "C:/MyPHP/php" AddType application/x-httpd-php .php .html .htmphp配置php.ini-development 文件重命名为 php.ini...

2014-12-14 14:17:00 156

转载 Apache 配置虚拟目录和虚拟主机

Apache配置虚拟目录在httpd.conf文件中添加 大约在245行# Create Virtual catalogue<IfModule dir_module> DirectoryIndex index.html index.htm index.php Alias /MyWeb "c:/MyWeb" // 在C盘的根目录下有一个Myw...

2014-12-13 22:38:00 143

转载 BUCT蓝桥杯热身赛II题解

A题编码(decode)签到题,没有可说的。 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <set> 5 6 using namespace std; 7 8 int main () {...

2014-11-30 19:48:00 266

转载 HDU - 5124 lines

Problem DescriptionJohn has several lines. The lines are covered on the X axis. Let A is a point which is covered by the most lines. John wants to know how many lines cover A.InputThe...

2014-11-29 23:46:00 107

转载 UVA - 165(邮票)

StampsThe government of Nova Mareterrania requires that various legal documents have stamps attached to them so that the government can derive revenue from them. In terms of r...

2014-11-29 15:51:00 78

转载 UVA - 10012

How Big Is It?Ian's going to California, and he has to pack his things, including his collection of circles. Given a set of circles, your program must find the smallest recta...

2014-11-29 10:13:00 75

转载 UVA - 331

Mapping the SwapsSorting an array can be done by swapping certain pairs of adjacent entries in the array. This is the fundamental technique used in the well-known bubble sort....

2014-11-28 19:56:00 83

转载 UVA - 539

The Settlers of CatanWithinSettlers of Catan, the 1995 German game of the year, players attempt to dominate an island by building roads, settlements and cities across its un...

2014-11-28 19:33:00 51

转载 UVA - 301

TransportationRuratania is just entering capitalism and is establishing new enterprising activities in many fields including transport. The transportation company TransRuratan...

2014-11-28 19:28:00 84

转载 UVA - 10344

Problem I23 Out of 5Input:standard inputOutput:standard outputTime Limit:1 secondMemory Limit:32 MBYour task is to write a program that can decide whether you can find an arithmet...

2014-11-28 12:35:00 82

转载 UVA - 639

Don't Get RookedIn chess, the rook is a piece that can move any number of squares vertically or horizontally. In this problem we will consider small chess boards (at ...

2014-11-28 11:59:00 79

转载 UVA - 216

Getting in LineComputer networking requires that the computers in the network be linked.This problem considers a ``linear" network in which the computers are chained toge...

2014-11-28 10:43:00 84

转载 UVA - 110

Meta-Loopless SortsBackgroundSorting holds an important place in computer science. Analyzing and implementing various sorting algorithms forms an important part of the e...

2014-11-28 09:39:00 65

转载 UVA - 146

ID CodesIt is 2084 and the year of Big Brother has finally arrived, albeit a century late. In order to exercise greater control over its citizens and thereby to counter a chro...

2014-11-26 20:36:00 99

空空如也

空空如也

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

TA关注的人

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