题库-HDU
文章平均质量分 80
snowy_smile
终于在ICPC World Final里拿到了气球!
再努力一点吧,坚持下去吧,梦想是会实现的! 人生会有低谷,但我更相信,未来也会有更多梦想能够实现~
展开
-
【HDU5532 2015长春赛区F】【LIS+剪枝】Almost Sorted Array 最多移除一元素后单调 O(n)
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-03 13:57:35 · 883 阅读 · 0 评论 -
【HDU5536 2015长春赛区 J】【字典树or暴力】Chip Factory 字典序做法+暴力做法
首先暴力做法竟然可以AC。#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",std原创 2015-11-03 13:59:03 · 774 阅读 · 0 评论 -
【HDU5533 2015长春赛区G】【结论题】Dancing Stars on Me 平面图的整点正多边形只有正四边形
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-03 13:58:23 · 1379 阅读 · 0 评论 -
【HDU5550 2015 CCPC 南阳国赛K】【DP 脑洞 好题】 Game Rooms 每层楼一属性,所有人各得其所 数轴映射+同属性区间段整体更新
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-03 16:36:01 · 1669 阅读 · 3 评论 -
【HDU5545 2015 CCPC 南阳国赛F】【差分约束思想 费用流思想】The Battle of Guandu 官渡之战 重要战场人数多 士兵流向转化问题为最短路spfa+dijkstra双写
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-04 16:13:02 · 1496 阅读 · 0 评论 -
【HDU1571】【有删除操作的队列模拟】下沙小面的(1)
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-05 10:17:02 · 1056 阅读 · 0 评论 -
【HDU4474 2012成都现场赛K】【搜索-BFS】Yet Another Multiple Problem 最小的要求字符集的数字倍数 余数哈希BFS
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-04 19:41:58 · 543 阅读 · 0 评论 -
【HDU1735】【模拟 确定必要条件排序贪心】作业本最小污浊字数统计
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-05 18:17:20 · 932 阅读 · 2 评论 -
【HDU3746】【KMP】Cyclic Nacklace 最少添加字符数使得原串出现循环节
#include#include#include#include#include#include#include#include#include#include#include#include#define MS(x,y) memset(x,y,sizeof(x))#define MC(x,y) memcpy(x,y,sizeof(x))#define ls o<<1原创 2015-11-04 21:16:42 · 635 阅读 · 0 评论 -
【HDU1263】【STL-MAP套MAP】(省份,水果,数量)MAP嵌套大开发
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-04 23:36:05 · 766 阅读 · 0 评论 -
【HDU5442 2015长春网络赛F】字符串最小表示法+函数逆用循环节法+翻转串字符串哈希法
这道题有两种比较优秀的O(n)做法前者是函数逆用循环节法,抓住了字符串最小表示法的所有性质后者是反转字符串哈希法,使用了字符串哈希。【HDU5442 2015长春网络赛F】字符串最小表示法+函数逆用循环节法——#include#include#include#include#include#include#include#include#incl原创 2015-11-05 15:55:21 · 578 阅读 · 0 评论 -
【HDU1409】【模拟 极端数据特判】Is It a Number 判定给定字符串是否为数类型
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-06 09:32:34 · 509 阅读 · 0 评论 -
【HDU1572】【旅行商问题 状压DP 数据小全排列暴力】下沙小面的(2)
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-05 10:33:41 · 727 阅读 · 0 评论 -
【HDU1360】【模拟】Spell checker 特殊规则大小写合法性检测
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-06 12:51:31 · 522 阅读 · 0 评论 -
【HDU1103】【模拟】Flo's Restaurant 餐厅吃饭排桌子
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-10 20:27:01 · 967 阅读 · 0 评论 -
【HDU1107】【模拟】武林 三个门派来回走定制方向单挑架
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-10 19:49:20 · 584 阅读 · 0 评论 -
【HDU5559 2015合肥赛区H】【观察找规律 构造】Frog and String 用最多k个字符构造长度为n的m不同回文串的串
Frog and StringTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 61 Accepted Submission(s): 20Special JudgeProblem DescriptionF原创 2015-11-16 18:44:23 · 2459 阅读 · 3 评论 -
【HDU5556 2015合肥赛区E】【最大团or二分图匹配】Land of Farms 不同编号不相邻条件下的最大农场数
Land of FarmsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 68 Accepted Submission(s): 34Problem DescriptionFarmer John and his brothers have found a new land. They are so excited and decid原创 2015-11-16 15:07:19 · 2117 阅读 · 0 评论 -
【HDU5515 2015沈阳赛区G】【解方程or二分 模拟】Game of Flying Circus 跑垒游戏 【翻译错误 出题事故】
Game of Flying CircusTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 28 Accepted Submission(s): 8Problem DescriptionThe discovery原创 2015-10-31 18:43:37 · 3207 阅读 · 2 评论 -
【HDU5524 BC61 div1 B】【SET模拟】Subtrees 二叉树不同子节点树的子树个数
SubtreesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 98 Accepted Submission(s): 55Problem DescriptionThere is a complete bin原创 2015-11-01 10:14:03 · 732 阅读 · 0 评论 -
【HDU5564 BestCoder Round 62 (div1)B】【DP转矩阵快速幂】Clarke and digits 长度在[l,r]范围内7倍数数个数要求相邻两位不为K
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-18 17:08:55 · 1565 阅读 · 4 评论 -
【HDU5540 2015 CCPC 南阳国赛A】【水题】Secrete Master Plan 矩形旋转
#includeint a[10],b[10];bool check(){ for(int i=0;i<4;i++) { int j; for(j=0;j<4;j++)if(a[(i+j)%4]!=b[j])break; if(j==4)return 1; } return 0;}int main(){ int casenum,casei; scanf("%d"原创 2015-11-02 00:27:48 · 843 阅读 · 0 评论 -
【HDU5542 2015 CCPC 南阳国赛C】【DP】The Battle of Chibi n个数中恰好长度为m的单升子序列数
#include#include#includeusing namespace std;const int Z=1e9+7;const int N=1005;int casenum,casei;int n,m;int a[N];int f[N][N];int d[N][N];int top;#includemapmop;map::iterator it;inline v原创 2015-11-02 00:28:58 · 1769 阅读 · 0 评论 -
【HDU5551 2015 CCPC 南阳国赛L】【水题】Huatuo's Medicine 药罐串线
#include int casenum,casei;int main(){ scanf("%d",&casenum); for(casei=1;casei<=casenum;casei++) { int n; scanf("%d",&n); printf("Case #%d: %d\n",casei,2*n-1); }}/*【trick&&吐槽】做题要看AC数。原创 2015-11-02 00:30:16 · 772 阅读 · 0 评论 -
【HDU5547 2015 CCPC 南阳国赛H】【DFS】Sudoku 4x4棋盘的填充
#include#include#define MS(x,y) memset(x,y,sizeof(x))int casenum,casei;int n;char s[10][10];bool line[4][4];bool list[4][4];bool sqr[4][4];int bl[4][4];bool dfs(int y,int x){ while(s[y][x]原创 2015-11-02 00:31:21 · 1299 阅读 · 0 评论 -
【HDU5512 2015沈阳赛区D】【签到题 gcd博弈】Pagodas 取数x+y或x-y
PagodasTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 22 Accepted Submission(s): 21Problem Descriptionn pagodas were standing原创 2015-10-31 18:06:25 · 1585 阅读 · 0 评论 -
【HDU5521 2015沈阳赛区M】【拆点最短路 dijkstra+heap】Meeting 集合内距离相同
MeetingTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 44 Accepted Submission(s): 8Problem DescriptionBessie and her friend El原创 2015-10-31 18:39:35 · 2561 阅读 · 0 评论 -
【HDU5522 BC61 div2 A】【暴力orSET】Numbers 是否存在x+y=z
NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/262144 K (Java/Others)Total Submission(s): 150 Accepted Submission(s): 111Problem DescriptionThere are n numbers A1,原创 2015-11-01 10:10:44 · 1035 阅读 · 0 评论 -
【HDU5546 2015 CCPC 南阳国赛G】【DFS】Ancient Go 棋盘围杀 优化写法O(n^2)
#include#include#includeusing namespace std;#define MS(x,y) memset(x,y,sizeof(x))#define MC(x,y) memcpy(x,y,sizeof(x))typedef long long LL;const int Z=1e9+7;const int N=12;const int dy[4]={-1原创 2015-11-02 00:32:51 · 1458 阅读 · 0 评论 -
【HDU5563 BestCoder Round 62 (div1)A】【计算几何 凸包】Clarke and five-pointed star 正五边形判定 正五角星判定
#include #include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c原创 2015-11-17 21:47:53 · 710 阅读 · 0 评论 -
【HDU5523 BC61 div1 A】Game 一行n个数从st到ed每点走一次
GameTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 249 Accepted Submission(s): 112Problem DescriptionXY is playing a game:ther原创 2015-11-01 10:12:49 · 750 阅读 · 0 评论 -
【HDU5543 2015 CCPC 南阳国赛D】【贪心+DP】Pick The Sticks 木棍重心放在容器内 贪心法+三维状态直接法
这题我采取了两种做法。下面提供两份代码。前者较为麻烦,但是基于一定的贪心原则, 状态少,效率高。后者写起来方便,速度稍慢。#include #include#includeusing namespace std;#define MS(x,y) memset(x,y,sizeof(x))#define MC(x,y) memcpy(x,y,sizeof(x))typedef原创 2015-11-02 13:37:03 · 1978 阅读 · 2 评论 -
【HDU5527 2015长春赛区A】【贪心 特判模拟】Too Rich 最多硬币数支付 因子思想 贪心打补丁
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-02 21:37:22 · 1812 阅读 · 1 评论 -
【HDU5534 2015长春赛区H】【树上DP转完全背包】Partial Tree 不同度不同权对应最大树权
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-02 21:38:45 · 1726 阅读 · 0 评论 -
【HDU5510 2015沈阳赛区B】【KMP or strstr for循环剪枝】Bazinga 循环处思维灵活转化 时间复杂度均摊思想
BazingaTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 73 Accepted Submission(s): 28Problem DescriptionLadies and gentlemen, plea原创 2015-10-31 18:10:14 · 1922 阅读 · 1 评论 -
【HDU5565 BestCoder Round 62 (div1)C】【STL or 二分答案 or 计数排序】Clarke and baton n个人减肥m次求最后异或值
【HDU5565 BestCoder Round 62 (div1)C】【优先队列做法】Clarke and baton n个人减肥m次求最后异或值 #include #include#include#include#include#include#include#include#include#include#include#include#includeusi原创 2015-11-18 10:38:56 · 784 阅读 · 0 评论 -
【HDU5568 BestCoder Round 63 (div1)A】【DP java高精度】sequence2 长度恰好为m的LIS数
sequence2Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 493 Accepted Submission(s): 183Problem DescriptionGiven an integer array原创 2015-11-25 09:34:11 · 609 阅读 · 0 评论 -
【HDU5569 BestCoder Round 63 (div1)B】【DP】matrix 向右走向下走最大乘积和
matrixTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 408 Accepted Submission(s): 243Problem DescriptionGiven a matrix with n row原创 2015-11-25 09:32:41 · 590 阅读 · 0 评论 -
【HDU5544 2015CCPC 南阳国赛E】【树上dfs找本质不同环 高斯消元 时间戳优化】Ba Gua Zhen 连通图上最大异或环
Ba Gua ZhenTime Limit: 6000/4000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 213 Accepted Submission(s): 76Problem DescriptionDuring the Three-原创 2015-11-19 15:31:55 · 2307 阅读 · 0 评论 -
【HDU5213 BestCoder Round 39D】【莫队算法+容斥】Lucky 两个区间各选一个数使得和为K的方案数
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-19 18:33:41 · 925 阅读 · 0 评论