自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

obsidian的博客

开开心心

  • 博客(18)
  • 收藏
  • 关注

原创 HDU 2044 一只小蜜蜂... (递推)

题目Problem Description有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房 aa 爬到蜂房 bb 的可能路线数。 其中,蜂房的结构如下所示。Input输入数据的第一行是一个整数 NN ,表示测试实例的个数,然后是 NN 行数据,每行包含两个整数 aa 和 bb (0<a<b<50)(0<a<b<50) 。Output对于每个测试实例,请输出蜜蜂从蜂房

2017-08-05 21:37:32 354

原创 POJ 3259 Wormholes (Bellman-Ford判断负环)

题目DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a

2017-08-05 21:16:12 282

原创 POJ 1789 Truck History (Prim算法求最小生成树)

题目DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing each

2017-08-04 00:50:20 322

原创 POJ 1125 Stockbroker Grapevine (Floyd)

题目DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge in

2017-08-03 21:22:42 211

原创 POJ 2524 Ubiquitous Religions (并查集)

题目DescriptionThere are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your uni

2017-08-03 19:52:48 243

原创 POJ 1704 Georgia and Bob (Nim博弈)

题目DescriptionGeorgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids from left to right by 11 , 22 , 33 , …, and place NN chessmen on different grids, a

2017-08-03 17:24:21 212

原创 POJ 2349(Kruskal) Arctic Network

题目The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every

2017-08-03 00:05:54 232 1

原创 HDU 4135 Co-prime

HDU 4135 Co-prime 传送门题意给出一个区间的左右端点,再给出区间里的一个数,然后需要求出在区间中有几个数与给定的数互素。思路暴力求解肯定是过不去的,会超时,这里需要利用容斥原理。假设当前m=12,n=10。第一步:求出给出数的质因子:2,3,5;第二步:(1,m)中是n的因子的倍数当然就不互质了(2,4,6,8,10)->n2\dfrac{n}{2} 6个,(3,6,9,12)->

2017-08-01 23:35:53 169

原创 Longest Regular Bracket Sequence

C. Longest Regular Bracket Sequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis is yet another pro

2017-07-31 20:51:10 277

原创 HDU 5698

瞬间移动Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1228    Accepted Submission(s): 607Problem Description有一个无限大的矩形,初始时你在左上角(即第一

2017-07-27 21:20:16 255

原创 HDU 3579 Hello Kiki

Hello KikiTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3959    Accepted Submission(s): 1512Problem DescriptionOne day I was s

2017-07-26 21:56:12 199

原创 最长上升子序列[模板]

最长上升子序列就是指在一个序列中,求出一个最长的子序列满足单调递增,同时各个元素在原序列中不要求连续。这个方法很巧妙,不妨进行如下考虑:对于序列中的元素A[x]首先有,B[1]=A[1]=4且len=1。接着考虑A[2],有B[1]=2,len=1,对于A[3],因为A[3]>B[len],所以有len=len+1,B[len]=6考虑A[4],可有B[2]=3

2017-07-12 00:35:19 238

原创 加密与解密

加密与解密发布时间: 2017年7月3日 07:38   时间限制: 1000ms   内存限制: 128M描述本问题请你写一个程序帮助某个公司加密和解密他们得到的信息。你可假定该公司给你的信息至多含80个字符,这些字符由大小写字母、空格和下面的6个字符组成:! , .: ; ?下面这些是信息中有效字符的ASCII表:字母 A B C … X Y Z 

2017-07-05 23:00:42 570

原创 【出圈】

Description设有n个人围坐一圈并按顺时针方向从1到n编号,从第1个人开始进行1到m的报数,报数到第个m人,此人出圈,再从他的下一个人重新开始1到m的报数,如此进行下去直到所剩下一人为止。Input输入多行,每行2个数,分别表示n和m.Output计算每一行中最后剩下这个人的编号.Sample Input10 3Sample

2017-07-04 23:28:06 350

原创 【偶数求和】

Description有一个长度为n(nInput输入数据有多组,每组占一行,包含两个正整数n和m,n和m的含义如上所述。Output对于每组输入数据,输出一个平均值序列,每组输出占一行Sample Input3 24 2Sample Output3 63 7代码:#includeint main(voi

2017-07-04 23:22:51 2201

原创 【C语言训练】尼科彻斯定理

Description验证尼科彻斯定理,即:任何一个正整数的立方都可以写成一串连续奇数的和。Input任一正整数Output该数的立方分解为一串连续奇数的和Sample Input13Sample Output13*13*13=2197=157+159+161+163+165+167+169+171+173+175+177+1

2017-07-04 23:21:00 980 1

原创 C语言考试练习题_排列

Description有4个互不相同的数字,输出由其中三个不重复数字组成的排列。Input4个整数。Output所有排列。Sample Input1 2 3 4Sample Output1 2 31 3 22 1 32 3 13 1 23 2 11 2 41 4 22 1 42 4 14 1 2

2017-07-04 23:18:41 801

原创 产生数(并查集)

废话不多说,并查集。。。Description给出一个整数 n(n规则:一位数可变换成另一个一位数:规则的右部不能为零。例如:n=234。有规则(k=2):2-> 53-> 6上面的整数 234 经过变换后可能产生出的整数为(包括原数):234534264564共 4 种不同的产生数问题:给出一个整数 n 和 k 个规则。

2017-07-04 23:16:19 308 1

空空如也

空空如也

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

TA关注的人

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