- 博客(61)
- 资源 (2)
- 收藏
- 关注
原创 统计英文中倒数第二个英文单词的个数
需求:从键盘上输入一行英文,求导数第二个单词的个数。(假设英文中不存在标点符号)(问题出处:C语言程序设计案例教程第二版P59,T10)#include<stdio.h>#include<stdlib.h>#include<string.h>int main(){ char lines[60]={0}; int i=0,j=0; print...
2019-03-12 10:49:11 664
原创 CF - 500B New Year Permutation
New Year PermutationTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uDescriptionUser ainta has a permutation(排列) p1, p2, ..., pn. As the New Year is com
2016-09-18 18:21:11 390
原创 CF - 500A New Year Transportation
New Year TransportationTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uDescriptionNew Year is coming in Line World! In this world, there are n cells numb
2016-09-18 17:00:04 352
原创 CF366A Dima and Guards
Dima and GuardsTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uDescriptionNothing has changed since the last round. Dima and Inna still love each other a
2016-08-24 09:18:30 247
原创 CF 597A Divisibility
DivisibilityTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uDescriptionFind the number of k-divisible numbers on the segment [a, b]. In other words you n
2016-08-23 20:04:49 968
原创 CF660A -- Co-prime Array
Co-prime ArrayTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uDescriptionYou are given an array of n elements, you must make it a co-prime array in as few
2016-08-22 21:12:33 466
原创 HDOJ -- 1114 Piggy-Bank
Piggy-BankTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial sup
2016-08-19 15:48:31 290
原创 HDOJ -- 1248 寒冰王座
寒冰王座Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前. 死亡骑士:"我要买
2016-08-18 21:00:46 333
原创 HDOJ -- 1203 I NEED A OFFER!
I NEED A OFFER!Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这
2016-08-16 16:19:09 225
原创 HDOJ -- 3466 Proud Merchants
Proud MerchantsTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uDescriptionRecently, iSea went to an ancient country. For such a long time, it was the most
2016-08-15 21:21:50 264
原创 HDOJ -- 2602 Bone Collector
Bone CollectorTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collect
2016-08-15 17:34:29 274 2
原创 HDOJ -- 2066 一个人的旅行
一个人的旅行Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历
2016-08-12 18:00:34 367
原创 POJ -- 1458 Common Subsequence
Common SubsequenceTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %lluDescriptionA subsequence of a given sequence is the given sequence with some elements (possi
2016-08-11 21:39:19 219
原创 HDOJ -- 2504 又见gcd
又见GCDTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description有三个正整数a,b,c(0 Input第一行输入一个n,表示有n组测试数据,接下来的n行,每行输入两个正整数a,b。 Output
2016-08-11 17:58:28 169
原创 HDOJ -- 1002 大数A+B
A + B Problem IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job
2016-08-11 17:53:32 278
原创 HDOJ -- 2041 超级楼梯
超级楼梯Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem Description有一楼梯共M级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第M级,共有多少种走法? Input输入数据首先包含一个整数N,表示测试实例的个
2016-08-11 17:47:49 755
原创 HDOJ -- 1201 18岁生日
18岁生日Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionGardon的18岁生日就要到了,他当然很开心,可是他突然想到一个问题,是不是每个人从出生开始,到达18岁生日时所经过的天数都是一样的呢?似乎并不全都是这样,所以他想
2016-08-11 17:44:55 405
原创 zzulioj -- 1908 小火山的围棋梦想
小火山的围棋梦想Time Limit: 1 Sec Memory Limit: 128 MBDescription 小火山最近喜欢上了围棋。 对于围棋,其实小火山是一窍不通的。现在棋盘上,有很多小火山的棋子。 如果棋盘上有这样的一个位置, 那么这个位置也会变成小火山的棋子;这样的位置是指小火山的棋子将该位置围起来。 现在,小火山想知道实际棋盘是什么样子的。
2016-08-11 10:20:36 352
原创 小火山的计算能力
小火山的计算能力Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 471 Solved: 123Description别人说小火山的计算能力不行,小火山很生气,于是他想证明自己,现在有一个表达式,他想计算出来。Input首先是一个t(1Output输出运算结果。Sample Input
2016-08-10 22:00:22 244
原创 HDOJ -- 1222 Wolf and Rabbit
Wolf and RabbitTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionThere is a hill with n holes around. The holes are signed from 0 to n-1
2016-08-10 20:54:00 227
原创 zzulioj -- 小火山的跳子游戏
小火山的跳子游戏Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 441 Solved: 98Description 小火山和火山火山在一块玩跳子游戏。规则如下: 1:跳子的起始位置为0,棋盘大小从1到N 2:每次跳子跳k步。 例如当前位置为i, 那么下一步为i + k 3:跳子过程中,碰到1或N则往回跳
2016-08-10 20:40:27 231
原创 免费馅饼
免费馅饼Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如
2016-08-09 19:54:04 180
原创 HDOJ -- 1260 Tickets
TicketsTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionJesus, what a great movie! Thousands of people are rushing to the cinema. However, this is
2016-08-09 16:08:10 168
原创 HDOJ -- 1231最大连续子序列
最大连续子序列Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 例如给定序列{ -2, 11,
2016-08-08 21:43:44 232
原创 HDOJ -- 2084 树塔
数塔Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? 已
2016-08-08 21:37:21 325
原创 HDOJ -- 1003 Max Sum
Max SumTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub
2016-08-08 20:16:04 236
原创 素数的变形
AlarmDESCRIPTIONGiven a number sequence [3,7,22,45,116,...][3,7,22,45,116,...]. Please tell me the kk-th number.INPUTA number T (T100)T (T indicates the number of the input
2016-08-05 21:46:06 261
原创 HDOJ -- 1285 确定比赛名次
确定比赛名次Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription有N个比赛队(1Input输入有若干组,每组中的第一行为二个数N(1Output给出一个符合要求的排名。输出时队伍号之
2016-08-05 15:26:38 247
原创 HDOJ -- 1596 find the safest road
find the safest roadTime Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionXX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,
2016-08-04 19:53:32 172
原创 HDOJ -- 1874畅通工程续
畅通工程续Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行
2016-08-04 17:53:53 243
原创 HDOJ -- 1869六度分离
六度分离Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6
2016-08-04 17:23:50 188
原创 HDOJ -- 2544最短路
最短路Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线
2016-08-04 16:28:53 241
原创 985的数字难题
985的数字难题Time Limit: 1 Sec Memory Limit: 128 MBDescription985有n个数,已知每次操作可以将其中不相同的两个数一个加一、一个减一,操作次数不限。问他最多可以得到多少个相同的数。Input第一行输入一个整数t,代表有t组测试数据。每组数据占两行,第一行输入一个n代表元素个数,下面一行
2016-08-04 11:03:29 195
原创 HDOJ -- 1863畅通工程
畅通工程Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成
2016-08-04 09:29:39 218
原创 HDOJ -- 1233 还是畅通工程
还是畅通工程Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达
2016-08-03 20:44:25 330
原创 令人头疼的并查集
刚开始接触就对这迷迷糊糊的,一直搞不懂,后来发现用处还不少,不得不从头来过啊!先来个高级定义:并查集是一种高级的数据结构,能用于处理不相交集合的合并及查询。求最小生成树、亲戚关系的判定、最小公共祖先等都要用到。并查集的使用主要有三步:定义数组并初始化、查找元素的根节点、合并不相交的集合。1、定义数组并初始化:int per[1001],n;//根据具体情况定义 for(int i
2016-08-03 19:30:41 306
原创 Farthest Nodes in a Tree
Farthest Nodes in a TreeTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluDescriptionGiven a tree (a connected graph with no cycles), you have to find the
2016-08-02 21:16:02 202
原创 POJ -- 1985 Cow Marathon
Cow MarathonTime Limit:2000MS Memory Limit:30000KB 64bit IO Format:%lld & %lluDescriptionAfter hearing about the epidemic of obesity in the USA, Farmer John wants his cows to g
2016-08-02 16:27:48 256
原创 整除-- 同余定理
Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluDescriptionIf an integer is not divisible by 2 or 5, some multiple of that number in decimal notation is a sequenc
2016-08-01 08:42:37 317
原创 HDOJ - 1242 Rescue
RescueTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described
2016-07-29 21:25:44 228
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人