自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(44)
  • 资源 (1)
  • 收藏
  • 关注

原创 HDU 1285 拓扑排序模板

确定比赛名次Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23243    Accepted Submission(s): 9412Problem Description有N个比赛队(1

2016-10-28 14:34:00 456

原创 Poj 1742 ROADS

ROADSTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 13840 Accepted: 5049DescriptionN cities named with numbers 1 ... N are connected with one-way roads

2016-10-02 19:29:55 354

原创 poj 生日蛋糕 搜索+剪枝

生日蛋糕Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 17937 Accepted: 6384Description7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1 R

2016-09-14 08:46:15 1910 2

原创 HDU 5418 TSP + 状态压缩

第一次写状态压缩的题目,遇到很多瓶颈, 不过好在都解决了, 状态压缩确实很难想象,但是如果仔细认真的一步一步做,一定也可以轻松A出来。      下面对遇到的瓶颈进行总结:(我做的是求一个最短路的题目)           先说一下思路,Ps:也是借鉴的其他人。           首先是输入的时候,因为可能两点之间有很多路,所以要在Map数组里面存入那条最短边。 存入之后用弗洛伊德求

2016-08-08 10:42:18 539

原创 模板,各个进制间的转换

这几天整理关于数学的模板,觉得进制间的转换非常需要整理一下,于是乎,就写了,进制随意转化的调用,看代码!!进制间的转换1.S数组为目标数组,s2数组储存转化后的结果。2.d1为原数的进制,d2为要转换的进制数。void conversion(char s[],char s2[],long d1,long d2){ long i, j, t, num; char c;

2016-05-21 10:50:55 525

原创 HDU - 1576 A / B(扩展欧几里得)

A/BTime Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3869    Accepted Submission(s): 2967Problem Description要求(A/B)%9973,但由于A很大,我们

2016-05-21 10:47:43 356

原创 BSG白山极客挑战赛——数数字(递推)

统计一下 aaa ⋯ aaan个a × b 的结果里面有多少个数字d,a,b,d均为一位数。样例解释:3333333333*3=9999999999,里面有10个9。Input多组测试数据。第一行有一个整数T,表示测试数据的数目。(1≤T≤5000)接下来有T行,每一行表示一组测试数据,有4个整数a,b,d,n。 (1

2016-05-21 09:11:58 543

原创 BSG白山极客挑战赛——B君的圆锥(计算几何)

B君要用一个表面积为S的圆锥将白山云包起来。B君希望包住的白山云体积尽量大,B君想知道体积最大可以是多少。注意圆锥的表面积包括底面和侧面。Input一行一个整数,表示表面积S。(1 Output一行一个实数,表示体积。Input示例8Output示例1.504506思路 :    一道高中的

2016-05-21 08:48:59 699

原创 基姆拉尔森计算公式(计算某天是星期几的模板)

What day is itTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4916    Accepted Submission(s): 1446Problem DescriptionToday is Sa

2016-05-20 10:42:28 540

原创 2016 百度之星资格赛 Problem C (Trie模板)

Problem Description度熊手上有一本神奇的字典,你可以在它里面做如下三个操作:1、insert : 往神奇字典中插入一个单词2、delete: 在神奇字典中删除所有前缀等于给定字符串的单词3、search: 查询是否在神奇字典中有一个字符串的前缀等于给定的字符串Input这里仅有一组测试数据。第一行输入一个正整数N (1\leq

2016-05-20 10:13:47 316

原创 HDU - 1754 I Hate It(线段树,点修改)

I Hate ItTime Limit: 9000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 60603    Accepted Submission(s): 23587Problem Description很多学校流行一种比较的习惯。

2016-05-14 18:44:39 280

原创 Balanced Lineup(RMQ)

Balanced LineupTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 43959 Accepted: 20624Case Time Limit: 2000MSDescriptionFor the daily milking, Far

2016-05-14 18:35:52 378

原创 HDU-1251 统计难题(前缀树)

统计难题Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 30080    Accepted Submission(s): 11716Problem DescriptionIgnatius最近遇到一个难题,老

2016-05-14 18:04:16 399

原创 HDU-2203 亲和串(KMP入门)

亲和串Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11556    Accepted Submission(s): 5208Problem Description人随着岁数的增长是越大越聪明还是越大越笨,

2016-05-14 17:58:19 314

原创 UVA - 11997 K Smallest Sums

题目链接题目大意:       有k个整数数组,各包含k个元素,在每个数组中取一个元素加起来,可以得到k的k次方个和。求这些和中最小的k个值。解题思路:       这个在刘汝佳的大白书P189页是一个例题,有完整的代码。就是先算两个的数组的和,然后依次往后计算,用优先队列存储这些和,然后把最小的加入第一个数组,然后把把新加入的和去掉然后加入下一个和(至于加入哪个和,看代码)。书上

2016-05-11 21:17:53 369

原创 树状数组

Lowbit函数引用自   http://blog.csdn.net/int64ago/article/details/7429868        本周学习了树状数组,用了一个上午多的时间,终于算有点头绪了,用这么长时间,困扰我的是它的思想,并不是树状数组本身的算法。        学习完之后,简单说一下树状数组的思想,其实不要把它看的太高深,树状数组,顾名思义他就是一个数组,至于为什么

2016-05-11 21:07:14 532

原创 uva-10534 Wavio Sequence

题目链接题目大意       从前往后n + 1个数都是递增的,然后从递增的最大一个值达到最后都是递减的也是n个数总共2*n+1个数。给你一个值求最长的一个满足上面要求的序列。思路:       从前往后求一次单调递增子序列,从后往前求一次单调递增子序列,每次记录下值然后记录最大值代码:#include#include#include#include#inc

2016-05-06 17:33:43 458

原创 uva-531 Compromise

题目链接(复制过来好难看)题目大意:       两个人写下一段话,让你寻找他们两个的最长公共的单词序列。思路:       只需要把最长公共子序列换成存储单词就可以代码:#include#include#includeusing namespace std;char a[105][35];char b[105][35];int dp[105][105];in

2016-05-06 17:20:53 395

原创 Anniversary party(树形dp第一步)

DescriptionThere is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor re

2016-05-06 17:09:03 1630

原创 UVA-10285 Longest Run on a Snowboard

题目拉不过来。。。。戳这里看吧题目大意:           下坡知道么,从高往低走,越走越快。此题是也是这个意思,给你一个矩阵,矩阵每个元素都有相应的值,然后可以滑到上下左右四个方向,每一次都加上1,问能得到最大的值。思路:            看到这个题就dfs了,but 会不会超时鸟~~~~并不会,只要每次都记录起他的值就可以(记忆化搜)更新就可以喽。思路很清晰代码

2016-05-06 16:57:09 388

原创 Let Me Count The Ways

DescriptionAfter making a purchase at a large department store, Mel's change was 17 cents. He received 1 dime, 1 nickel, and 2 pennies. Later that day, he was shopping at a convenience store.

2016-05-06 16:44:12 863

原创 Unidirectional TSP(dp)

DescriptionBackgroundProblems that require minimum paths through some domain appear in many different areas of computer science. For example, one of the constraints in VLSI routing problem

2016-05-06 16:37:58 546

原创 Nested Dolls (单调递增子序列 + 二分)

DescriptionDilworth is the world’s most prominent collector of Russian nested dolls: he literally has thousands of them! You know, the wooden hollow dolls of different sizes of which the smallest

2016-05-06 16:20:12 713

原创 大数整除(大数mod)

Description定理:把一个至少两位的正整数的个位数字去掉,再从余下的数中减去个位数的5倍。当且仅当差是17的倍数时,原数也是17的倍数 。例如,34是17的倍数,因为3-20=-17是17的倍数;201不是17的倍数,因为20-5=15不是17的倍数。输入一个正整数n,你的任务是判断它是否是17的倍数。Input输入文件最多包含10组测试数据,每个数据占一行

2016-04-30 17:41:17 3012

原创 Bone Collector

DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave … Th

2016-04-30 17:27:19 414

原创 nyist 硬币找零(完全背包)

硬币找零时间限制:1000 ms  |  内存限制:65535 KB难度:3描述在现实生活中,我们经常遇到硬币找零的问题,例如,在发工资时,财务人员就需要计算最少的找零硬币数,以便他们能从银行拿回最少的硬币数,并保证能用这些硬币发工资。我们应该注意到,人民币的硬币系统是 100,50,20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0

2016-04-29 17:25:52 678

原创 UVA-348 Optimal Array Multiplication Sequence

DescriptionGiven two arrays A and B, we can determine the array C = AB using the standard definition of matrix multiplication:The number of columns in the A array must be the same as the

2016-04-29 16:53:57 1453

原创 矩形嵌套 ————DAG(有向无环图)上的动态规划

矩形嵌套时间限制:3000 ms  |  内存限制:65535 KB难度:4描述有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a<c,b<d或者b<c,a<d(相当于旋转X90度)。例如(1,5)可以嵌套在(6,2)内,但不能嵌套在(3,4)中。你的任务是选出尽可能多的矩形排成一行,使得除最后一个外,每一个矩

2016-04-27 19:24:15 1031

原创 hdoj 5672 String (尺取法)

DescriptionThere is a string $S$.$S$ only contain lower case English character.$(10 \leq length(S) \leq 1,000,000)$ How many substrings there are that contain at least $k(1 \leq k \leq 26)$ dist

2016-04-26 21:25:04 575

原创 Machine

Problem DescriptionThere is a machine with m (2\leq m\leq 30)m(2≤m≤30) coloured bulbs and a button.When the button is pushed, the rightmost bulb changes. For any changed bulb,if it is red no

2016-04-22 21:08:48 660

原创 UVA-558 Wormholes(Floyd)

DescriptionIn the year 2163, wormholes were discovered. A wormhole is a subspace tunnel through space and time connecting two star systems. Wormholes have a few peculiar properties:

2016-04-22 14:41:01 674 1

原创 UVA-111 History Grading

BackgroundMany problems in Computer Science involve maximizing some measure according to constraints.Consider a history exam in which students are asked to put several historical events into

2016-04-21 21:40:57 456

原创 A Knight's Journey (搜索)

DescriptionBackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. Whenever a knight moves, it is

2016-04-21 15:55:18 949

原创 UVA-307 Sticks (搜索剪枝)

DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many s

2016-04-21 10:22:01 653

原创 UVA-167The Sultan's Successors(八皇后问题)

DescriptionThe Sultan of Nubia has no children, so she has decided that the country will be split into up tok separate parts on her death and each part will be inherited by whoever performs be

2016-04-20 15:06:22 1101 2

原创 dp 最大递增子序列

Longest Ordered SubsequenceTime Limit: 2 Seconds      Memory Limit: 65536 KBA numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence (a1, a2

2015-08-04 14:39:15 378

原创 dp第一步!!!!最长公共子序列 POJ 1458

Common SubsequenceTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 42968 Accepted: 17386DescriptionA subsequence of a given sequence is the given sequenc

2015-08-03 16:42:03 405

原创 STL之 next_permutation函数{(全排列)按字典序!!!!!}

next_permutation函数 今天做题时,用到了这个函数,亮瞎我的双眼~~~先贴出来题目!!!!!!DescriptionYou are to write a program that has to generate all possible words from a given set of letters. Example: Give

2015-07-28 19:06:38 1284

原创 HDU 2068 RPG的错排(组合数的处理)

Problem Description今年暑假杭电ACM集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,G是月野兔;......可怜的野骆驼第六次终于把RPG分清楚了。由于RPG的带动,做ACM的

2015-07-25 08:11:29 460

原创 HDU 1290 献给杭电五十周年校庆的礼物(递推)

Problem Description或许你曾经牢骚满腹或许你依然心怀忧伤或许你近在咫尺或许你我天各一方对于每一个学子母校 永远航行在生命的海洋今年是我们杭电建校五十周年,这是一个值得祝福的日子。我们该送给母校一个怎样的礼物呢?对于目前的大家来说,最好的礼物当然是省赛中的好成绩,我不能参赛,就送给学校一个DOOM III球形大蛋糕吧,这可是名牌,估计

2015-07-24 10:12:42 1015 2

中国省市县区.rar

中国省市县地区表,共 3000 + 数据 包含省份中的区的数据,更新于2019年 6月 数据字段有id ,parentCode ,districtName ,districtLevel ( 地区等级 1、省级 2、市级 3、县级 ) adCode

2019-06-25

空空如也

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

TA关注的人

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