随笔 - 390,  文章 - 34,  评论 - 62,  阅读 - 139万
08 2012 档案
HDU 1078 FatMouse and Cheese ----------mDFS
摘要:FatMouse and CheeseTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2829Accepted Submission(s): 1098Problem DescriptionFatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is label 阅读全文
posted @ 2012-08-31 21:37 可笑痴狂 阅读(1147) 评论(0) 推荐(0) 编辑
HDU 1869 六度分离 -----Floyd
摘要:六度分离Time Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1791Accepted Submission(s): 696Problem Description1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six degree 阅读全文
posted @ 2012-08-29 15:28 可笑痴狂 阅读(949) 评论(5) 推荐(0) 编辑
HDU 1896 Stones 优先队列
摘要:StonesTime Limit: 5000/3000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 455Accepted Submission(s): 261Problem DescriptionBecause of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a littl 阅读全文
posted @ 2012-08-29 12:34 可笑痴狂 阅读(373) 评论(0) 推荐(0) 编辑
HDU-1042 N!
摘要:N!Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 34699Accepted Submission(s): 9717Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N!InputOne N in one line, process to the end of file.OutputFor each N, output N! in 阅读全文
posted @ 2012-08-28 21:27 可笑痴狂 阅读(708) 评论(0) 推荐(0) 编辑
HDU-2048 神、上帝以及老天爷
摘要:神、上帝以及老天爷Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13589Accepted Submission(s): 5811Problem DescriptionHDU 2006'10 ACM contest的颁奖晚会隆重开始了!为了活跃气氛,组织者举行了一个别开生面、奖品丰厚的抽奖活动,这个活动的具体要求是这样的:首先,所有参加晚会的人员都将一张写有自己名字的字条放入抽奖箱中;然后,待所有字条加入完毕,每人从箱中取一个字条;最 阅读全文
posted @ 2012-08-28 21:10 可笑痴狂 阅读(2659) 评论(0) 推荐(0) 编辑
HDU 1065 I Think I Need a Houseboat
摘要:I Think I Need a HouseboatTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5395Accepted Submission(s): 1615Problem DescriptionFred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the lan 阅读全文
posted @ 2012-08-28 20:32 可笑痴狂 阅读(2210) 评论(0) 推荐(0) 编辑
HDU-3177 Crixalis's Equipment
摘要:Crixalis's EquipmentTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1481Accepted Submission(s): 607Problem DescriptionCrixalis - Sand King used to be a giant scorpion(蝎子) in the deserts of Kalimdor. Though he's a guardian of Lich King now, 阅读全文
posted @ 2012-08-24 14:22 可笑痴狂 阅读(235) 评论(0) 推荐(0) 编辑
POJ-1251 Jungle Roads
摘要:Jungle RoadsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 15610Accepted: 6988DescriptionThe Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so 阅读全文
posted @ 2012-08-24 14:08 可笑痴狂 阅读(2048) 评论(0) 推荐(0) 编辑
NYOJ-254 编号统计
摘要:编号统计时间限制:2000 ms | 内存限制:65535 KB难度:2描述zyc最近比较无聊,于是他想去做一次无聊的统计一下。他把全校同学的地址都统计了一下(zyc都将地址转化成了编码),然后他希望知道那个地方的同学最多(如果同学最多的地方有多个,输出编号最小的一个)。输入第一行输入一个正整数T(0<T<=11)表示有T组测试数据每组测试数据第一行输入一个正整数N(0<N<200000)表示有N个编号,随后输入N个编码(编码由数字组成且少于十位)输出每组数据输出占一行输出出现次数最多的编号样例输入1512345 456 45 78 78样例输出78 1 //2011- 阅读全文
posted @ 2012-08-23 17:59 可笑痴狂 阅读(308) 评论(0) 推荐(0) 编辑
HDU-1050 Moving Tables
摘要:Moving TablesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11406Accepted Submission(s): 3898Problem DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 阅读全文
posted @ 2012-08-23 16:54 可笑痴狂 阅读(1881) 评论(0) 推荐(0) 编辑
HDU-1051Wooden Sticks --贪心
摘要:Wooden SticksTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6563Accepted Submission(s): 2707Problem DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodwo 阅读全文
posted @ 2012-08-23 15:53 可笑痴狂 阅读(4507) 评论(0) 推荐(0) 编辑
POJ-1017 Packets
摘要:PacketsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 36663Accepted: 12207DescriptionA factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always delivered to customers in the square parcels of the same h 阅读全文
posted @ 2012-08-23 11:01 可笑痴狂 阅读(341) 评论(0) 推荐(0) 编辑
HDU 1421 搬寝室
摘要:搬寝室Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9709Accepted Submission(s): 3266Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的 阅读全文
posted @ 2012-08-23 09:13 可笑痴狂 阅读(1134) 评论(0) 推荐(1) 编辑
HDU-2159 FATE 二维背包
摘要:FATETime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3955Accepted Submission(s): 1750Problem Description最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐 阅读全文
posted @ 2012-08-22 22:50 可笑痴狂 阅读(2114) 评论(0) 推荐(0) 编辑
HDOJ-3339 In Action --------dijkstra+0-1背包
摘要:In ActionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2157Accepted Submission(s): 712Problem DescriptionSince 1945, when the first nuclear bomb was exploded by the Manhattan Project team in the US, the number of nuclear weapons have soared acros 阅读全文
posted @ 2012-08-22 21:37 可笑痴狂 阅读(284) 评论(0) 推荐(0) 编辑
HDOJ-1385 Minimum Transport Cost -----路径记录floyd
摘要:Minimum Transport CostTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4503Accepted Submission(s): 1121Problem DescriptionThese are N cities in Spring country. Between each pair of cities there may be one transportation track or none. Now there is s 阅读全文
posted @ 2012-08-22 13:05 可笑痴狂 阅读(318) 评论(0) 推荐(0) 编辑
HDOJ-2066 一个人的旅行 ------floyd
摘要:一个人的旅行Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10134Accepted Submission(s): 3432Problem Description虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看 阅读全文
posted @ 2012-08-21 23:12 可笑痴狂 阅读(524) 评论(0) 推荐(0) 编辑
HDOJ-1548 A strange lift -------BFS/dijkstra
摘要:A strange liftTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6572Accepted Submission(s): 2443Problem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.T 阅读全文
posted @ 2012-08-21 18:30 可笑痴狂 阅读(305) 评论(0) 推荐(0) 编辑
POJ-3767 I Wanna Go Home -----有限制的dijkstra
摘要:I Wanna Go HomeTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 2481Accepted: 1035DescriptionThe country is facing a terrible civil war----cities in the country are divided into two parts supporting different leaders. As a merchant, Mr. M does not pay attention to politics but he actually kn 阅读全文
posted @ 2012-08-21 17:39 可笑痴狂 阅读(398) 评论(0) 推荐(0) 编辑
NYOJ-45 棋盘覆盖
摘要:棋盘覆盖时间限制:3000 ms | 内存限制:65535 KB难度:3描述在一个2k×2k(1<=k<=100)的棋盘中恰有一方格被覆盖,如图1(k=2时),现用一缺角的2×2方格(图2为其中缺右下角的一个),去覆盖2k×2k未被覆盖过的方格,求需要类似图2方格总的个数s。如k=1时,s=1;k=2时,s=5图1图2 输入第一行m表示有m组测试数据;每一组测试数据的第一行有一个整数数k;输出输出所需个数s;样例输入3123样例输出1521 1 /* 功能Function Description: NYOJ-45 2 开发环境Environment: 阅读全文
posted @ 2012-08-21 11:40 可笑痴狂 阅读(518) 评论(0) 推荐(0) 编辑
NKOJ-1437 校长杯 ---赛程编制
摘要:[ Source : Seaeagle ]1437: 校长杯Time Limit: 1500 ms Memory Limit: 32000 kB Judge type: Multi-cases Special JudgeTotal Submit : 113(54 users)Accepted Submit : 70(48 users)Page View : 3989Font Style: Aa Aa Aa 在南开大学,一年一度的“校长杯”三大球比赛是广大师生必不可少的一次运动大餐。随着南开大学学校规模的扩大和体育事业的发展,参与校长杯赛事的师生越来越多。竞赛采用的是传统的“循环赛”制,即每.. 阅读全文
posted @ 2012-08-21 09:58 可笑痴狂 阅读(666) 评论(0) 推荐(0) 编辑
棋盘覆盖----分治和递归
摘要:棋盘覆盖问题Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KBTotal submit users: 62, Accepted users: 26Problem 10432 : No special judgementProblem description在一个2k x 2k ( 即:2^k x 2^k )个方格组成的棋盘中,恰有一个方格与其他方格不同,称该方格为一特殊方格,且称该棋盘为一特殊棋盘。在棋盘覆盖问题中,要用图示的4种不同形态的L型骨牌覆盖给定的特殊棋盘上除特殊方格以外的所有方格,且任何2个L型骨牌 阅读全文
posted @ 2012-08-20 21:09 可笑痴狂 阅读(529) 评论(0) 推荐(0) 编辑
HDOJ-1242 Rescue -------BFS
摘要:RescueTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8980Accepted Submission(s): 3301Problem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, 阅读全文
posted @ 2012-08-20 12:58 可笑痴狂 阅读(311) 评论(0) 推荐(0) 编辑
HDOJ-1399 Starship Hakodate-maru
摘要:Starship Hakodate-maruTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 243Accepted Submission(s): 175Problem DescriptionThe surveyor starship Hakodate-maru is famous for her two fuel containers with unbounded capacities. They hold the same type of a 阅读全文
posted @ 2012-08-20 11:11 可笑痴狂 阅读(572) 评论(0) 推荐(0) 编辑
HDOJ-1280 前m大的数
摘要:前m大的数Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5524Accepted Submission(s): 1965Problem Description还记得Gardon给小希布置的那个作业么?(上次比赛的1005)其实小希已经找回了原来的那张数表,现在她想确认一下她的答案是否正确,但是整个的答案是很庞大的表,小希只想让你把答案中最大的M个数告诉她就可以了。 给定一个包含N(N<=3000)个正整数的序列,每个数不超过5000,对 阅读全文
posted @ 2012-08-20 10:10 可笑痴狂 阅读(700) 评论(0) 推荐(0) 编辑
HDOJ-1128 Self Numbers
摘要:Self NumbersTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4487Accepted Submission(s): 1961Problem DescriptionIn 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d( 阅读全文
posted @ 2012-08-20 09:26 可笑痴狂 阅读(1543) 评论(0) 推荐(0) 编辑
HDOJ-2553 N皇后问题
摘要:N皇后问题Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3464Accepted Submission(s): 1599Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。Outpu 阅读全文
posted @ 2012-08-19 19:26 可笑痴狂 阅读(9207) 评论(1) 推荐(1) 编辑
NYOJ-14 会场安排问题 -----贪心
摘要:会场安排问题时间限制:3000 ms | 内存限制:65535 KB难度:4描述学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办。小刘的工作就是安排学校小礼堂的活动,每个时间最多安排一个活动。现在小刘有一些活动计划的时间表,他想尽可能的安排更多的活动,请问他该如何安排。输入第一行是一个整型数m(m<100)表示共有m组测试数据。每组测试数据的第一行是一个整数n(1<n<10000)表示该测试数据共有n个活动。随后的n行,每行有两个正整数Bi,Ei(0<=Bi,Ei<10000),分别表示第i个活动的起始与结束时间(Bi 阅读全文
posted @ 2012-08-18 16:46 可笑痴狂 阅读(644) 评论(0) 推荐(0) 编辑
HDOJ-1999 不可摸数
摘要:不可摸数Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5334Accepted Submission(s): 1405Problem Descriptions(n)是正整数n的真因子之和,即小于n且整除n的因子和.例如s(12)=1+2+3+4+6=16.如果任何数m,s(m)都不等于n,则称n为不可摸数.Input包含多组数据,首先输入T,表示有T组数据.每组数据1行给出n(2<=n<=1000)是整数。Output如果n是不可 阅读全文
posted @ 2012-08-18 16:43 可笑痴狂 阅读(3148) 评论(0) 推荐(0) 编辑
NYOJ-284 坦克大战 ------BFS/优先队列
摘要:坦克大战时间限制:1000 ms | 内存限制:65535 KB难度:3描述Many of us had played the game "Battle city" in our childhood, and some people (like me) even often play it on computer now. What we are discussing is a simple edition of this game. Given a map that consists of empty spaces, rivers, steel walls and bri 阅读全文
posted @ 2012-08-17 19:20 可笑痴狂 阅读(752) 评论(0) 推荐(0) 编辑
POJ-1127 Jack Straws
摘要:Jack StrawsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 2624Accepted: 1183DescriptionIn the game of Jack Straws, a number of plastic or wooden "straws" are dumped on the table and players try to remove them one-by-one without disturbing the other straws. Here, we are only conce 阅读全文
posted @ 2012-08-17 15:19 可笑痴狂 阅读(493) 评论(0) 推荐(0) 编辑
POJ-1664 放苹果
摘要:放苹果Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 21021Accepted: 13395Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。Output对输入的每组数据M和N,用一行输出相应的K。Sample Input17 3Sample Output8 1 /* 功能 阅读全文
posted @ 2012-08-15 17:29 可笑痴狂 阅读(16305) 评论(3) 推荐(7) 编辑
POJ-3264 Balanced Lineup -------RMQ/线段树
摘要:Balanced LineupTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 23931Accepted: 11122Case Time Limit: 2000MSDescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with som 阅读全文
posted @ 2012-08-15 16:56 可笑痴狂 阅读(349) 评论(0) 推荐(0) 编辑
NYOJ-119 士兵杀敌(三) --------------RMQ
摘要:士兵杀敌(三)时间限制:2000 ms | 内存限制:65535 KB难度:5描述南将军统率着N个士兵,士兵分别编号为1~N,南将军经常爱拿某一段编号内杀敌数最高的人与杀敌数最低的人进行比较,计算出两个人的杀敌数差值,用这种方法一方面能鼓舞杀敌数高的人,另一方面也算是批评杀敌数低的人,起到了很好的效果。所以,南将军经常问军师小工第i号士兵到第j号士兵中,杀敌数最高的人与杀敌数最低的人之间军功差值是多少。现在,请你写一个程序,帮小工回答南将军每次的询问吧。注意,南将军可能询问很多次。输入只有一组测试数据第一行是两个整数N,Q,其中N表示士兵的总数。Q表示南将军询问的次数。(1<N<= 阅读全文
posted @ 2012-08-15 13:28 可笑痴狂 阅读(438) 评论(0) 推荐(0) 编辑
NYOJ-488 素数环
摘要:素数环时间限制:1000 ms | 内存限制:65535 KB难度:2描述有一个整数n,把从1到n的数字无重复的排列成环,且使每相邻两个数(包括首尾)的和都为素数,称为素数环。为了简便起见,我们规定每个素数环都从1开始。例如,下图就是6的一个素数环。输入有多组测试数据,每组输入一个n(0<n<20),n=0表示输入结束。输出每组第一行输出对应的Case序号,从1开始。如果存在满足题意叙述的素数环,从小到大输出。否则输出No Answer。样例输入6830样例输出Case 1:1 4 3 2 5 61 6 5 2 3 4Case 2:1 2 3 8 5 6 7 41 2 5 8 3 阅读全文
posted @ 2012-08-15 09:06 可笑痴狂 阅读(4574) 评论(0) 推荐(1) 编辑
NYOJ-58 最小步数
摘要:最少步数时间限制:3000 ms | 内存限制:65535 KB难度:4描述这有一个迷宫,有0~8行和0~8列:1,1,1,1,1,1,1,1,11,0,0,1,0,0,1,0,11,0,0,1,1,0,0,0,11,0,1,0,1,1,0,1,11,0,0,0,0,1,0,0,11,1,0,1,0,1,0,0,11,1,0,1,0,1,0,0,11,1,0,1,0,0,0,0,11,1,1,1,1,1,1,1,10表示道路,1表示墙。现在输入一个道路的坐标作为起点,再如输入一个道路的坐标作为终点,问最少走几步才能从起点到达终点?(注:一步是指从一坐标点走到其上下左右相邻坐标点,如:从(3,1 阅读全文
posted @ 2012-08-14 23:06 可笑痴狂 阅读(1107) 评论(0) 推荐(0) 编辑
POJ-1011 Sticks
摘要:SticksTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 99807Accepted: 22696DescriptionGeorge 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 sticks he had originally 阅读全文
posted @ 2012-08-14 22:06 可笑痴狂 阅读(4781) 评论(0) 推荐(3) 编辑
POJ-1164 The Castle ------------DFS
摘要:The CastleTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 5536Accepted: 3116Description 1 2 3 4 5 6 7 ############################# 1 # | # | # | | # #####---#####---#---#####---# 2 # # | # # # # # #---#####---#####---#####---# 3 # | |... 阅读全文
posted @ 2012-08-14 17:30 可笑痴狂 阅读(433) 评论(0) 推荐(0) 编辑
HDOJ-1711 Number Sequence
摘要:Number SequenceTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6050Accepted Submission(s): 2721Problem DescriptionGiven two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 100 阅读全文
posted @ 2012-08-14 11:09 可笑痴狂 阅读(334) 评论(0) 推荐(0) 编辑
HDOJ-1686 Oulipo ------------------KMP
摘要:OulipoTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2620Accepted Submission(s): 1012Problem DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo gr 阅读全文
posted @ 2012-08-14 10:08 可笑痴狂 阅读(307) 评论(0) 推荐(0) 编辑
POJ 1961 Period --------KMP
摘要:PeriodTime Limit: 3000MSMemory Limit: 30000KTotal Submissions: 9758Accepted: 4461DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 <= i 阅读全文
posted @ 2012-08-14 09:28 可笑痴狂 阅读(1304) 评论(0) 推荐(0) 编辑
NYOJ -55 懒省事的小明
摘要:懒省事的小明时间限制:3000 ms | 内存限制:65535 KB难度:3描述 小明很想吃果子,正好果园果子熟了。在果园里,小明已经将所有的果子打了下来,而且按果子的不同种类分成了不同的堆。小明决定把所有的果子合成一堆。 因为小明比较懒,为了省力气,小明开始想点子了: 每一次合并,小明可以把两堆果子合并到一起,消耗的体力等于两堆果子的重量之和。可以看出,所有的果子经过n-1次合并之后,就只剩下一堆了。小明在合并果子时总共消耗的体力等于每次合并所耗体力之和。 因为还要花大力气把这些果子搬回家,所以小明在合并果子时要尽可能地节省体力。假定每个果子重量都为1,并且已知果子的种类数和每种果子的... 阅读全文
posted @ 2012-08-13 22:42 可笑痴狂 阅读(333) 评论(0) 推荐(0) 编辑
NYOJ-19 擅长排列的小明 -----回溯
摘要:擅长排列的小明时间限制:1000 ms | 内存限制:65535 KB难度:4描述小明十分聪明,而且十分擅长排列计算。比如给小明一个数字5,他能立刻给出1-5按字典序的全排列,如果你想为难他,在这5个数字中选出几个数字让他继续全排列,那么你就错了,他同样的很擅长。现在需要你写一个程序来验证擅长排列的小明到底对不对。输入第一行输入整数N(1<N<10)表示多少组测试数据,每组测试数据第一行两个整数 n m (1<n<9,0<m<=n)输出在1-n中选取m个字符进行全排列,按字典序全部输出,每种排列占一行,每组数据间不需分界。如样例样例输入23 14 2样例输出 阅读全文
posted @ 2012-08-13 22:00 可笑痴狂 阅读(293) 评论(1) 推荐(0) 编辑
HDOJ 2574 Hdu Girls' Day
摘要:Hdu Girls' DayTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 742Accepted Submission(s): 241Problem DescriptionHdu Girls' Day is a traditional activity in Hdu. Girls in Hdu participate in the activity and show their talent and skill. The gi 阅读全文
posted @ 2012-08-13 19:43 可笑痴狂 阅读(655) 评论(0) 推荐(0) 编辑
HDOJ 1272 小希的迷宫
摘要:小希的迷宫Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14388Accepted Submission(s): 4378Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提 阅读全文
posted @ 2012-08-13 16:49 可笑痴狂 阅读(367) 评论(0) 推荐(0) 编辑
POJ-2752 Seek the Name, Seek the Fame -------KMP
摘要:Seek the Name, Seek the FameTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 8261Accepted: 3883DescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the sam 阅读全文
posted @ 2012-08-13 13:28 可笑痴狂 阅读(3563) 评论(0) 推荐(1) 编辑
HDOJ 2087 剪花布条 --------KMP算法
摘要:剪花布条Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4655Accepted Submission(s): 3130Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少 阅读全文
posted @ 2012-08-13 11:25 可笑痴狂 阅读(632) 评论(0) 推荐(0) 编辑
POJ -2406 power strings --KMP中next函数的应用
摘要:Power StringsTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 23370Accepted: 9811DescriptionGiven two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplica 阅读全文
posted @ 2012-08-13 10:47 可笑痴狂 阅读(435) 评论(0) 推荐(0) 编辑
NYOJ-525 一道水题
摘要:一道水题时间限制:1000 ms | 内存限制:65535 KB难度:2描述今天LZQ在玩一种小游戏,但是这游戏数有一点点的大,他一个人玩的累,想多拉一些人进来帮帮他,你能写一个程序帮帮他吗?这个游戏是这样的:有一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出,大家赶紧写个程序来帮帮LZQ吧!输入输入包含多组测试用例,每组输入数据只有一行数字(数字之间没有空格),这行数字的长度不大 阅读全文
posted @ 2012-08-12 20:36 可笑痴狂 阅读(3424) 评论(0) 推荐(1) 编辑
HDOJ 2094 产生冠军
摘要:产生冠军Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5027Accepted Submission(s): 2409Problem Description有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。球赛的规则如下:如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。根据这个规则,无需循环较量,或许就能 阅读全文
posted @ 2012-08-12 20:19 可笑痴狂 阅读(1748) 评论(0) 推荐(0) 编辑
POJ 2503 Babelfish 字典树
摘要:BabelfishTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 24994Accepted: 10703DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consist 阅读全文
posted @ 2012-08-10 17:59 可笑痴狂 阅读(362) 评论(0) 推荐(0) 编辑
POJ -2513 Colored Sticks 字典树 + 并查集 + 欧拉路
摘要:Colored SticksTime Limit: 5000MSMemory Limit: 128000KTotal Submissions: 24844Accepted: 6542DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpoints that touch 阅读全文
posted @ 2012-08-10 17:06 可笑痴狂 阅读(235) 评论(0) 推荐(0) 编辑
HDOJ-1800 Flying to the Mars(贪心 + 字典树 + BST)
摘要:Flying to the MarsTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6271Accepted Submission(s): 2053Problem DescriptionIn the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to find more land for the newborns . 阅读全文
posted @ 2012-08-10 16:28 可笑痴狂 阅读(1666) 评论(2) 推荐(0) 编辑
HDOJ-1075 What Are You Talking About 字典树查找
摘要:What Are You Talking AboutTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 7414Accepted Submission(s): 2292Problem DescriptionIgnatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian 阅读全文
posted @ 2012-08-10 11:44 可笑痴狂 阅读(1725) 评论(0) 推荐(0) 编辑
NYOJ-290 动物统计加强版 -----字典树
摘要:动物统计加强版时间限制:3000 ms | 内存限制:150000 KB难度:4描述在美丽大兴安岭原始森林中存在数量繁多的物种,在勘察员带来的各种动物资料中有未统计数量的原始动物的名单。科学家想判断这片森林中哪种动物的数量最多,但是由于数据太过庞大,科学家终于忍受不了,想请聪明如你的ACMer来帮忙。输入第一行输入动物名字的数量N(1<= N <= 4000000),接下来的N行输入N个字符串表示动物的名字(字符串的长度不超过10,字符串全为小写字母,并且只有一组测试数据)。输出输出这些动物中最多的动物的名字与数量,并用空格隔开(数据保证最多的动物不会出现两种以上)。样例输入10b 阅读全文
posted @ 2012-08-10 09:28 可笑痴狂 阅读(533) 评论(0) 推荐(0) 编辑
NYOJ-236 彩色棒 字典树 + 并查集 + 欧拉路
摘要:彩色棒时间限制:1000 ms | 内存限制:128000 KB难度:5描述You are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpoints that touch are of the same color?输入the frist line have a number k(0<k&l 阅读全文
posted @ 2012-08-09 21:52 可笑痴狂 阅读(348) 评论(0) 推荐(0) 编辑
HDOJ-1671 Phone List 字典树的应用----判断一组字符串中是否有一个字符串是另一个字符串的前缀(字典树第二类应用)。
摘要:Phone ListTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5081Accepted Submission(s): 1714Problem DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone cata 阅读全文
posted @ 2012-08-09 18:07 可笑痴狂 阅读(1605) 评论(0) 推荐(0) 编辑
HDOJ-1251 统计难题 字典树的应用-----统计一组字符串中某前缀出现次数(字典树第一类应用),
摘要:统计难题Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 10380Accepted Submission(s): 4278Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统 阅读全文
posted @ 2012-08-09 16:51 可笑痴狂 阅读(513) 评论(0) 推荐(0) 编辑
NYOJ-228 士兵杀敌(五)
摘要:士兵杀敌(五)时间限制:2000 ms | 内存限制:65535 KB难度:5描述南将军麾下有百万精兵,现已知共有M个士兵,编号为0~M,每次有任务的时候,总会有一批编号连在一起人请战(编号相近的人经常在一块,相互之间比较熟悉),最终他们获得的军功,也将会平分到每个人身上,这样,有时候,计算他们中的哪一个人到底有多少军功就是一个比较困难的事情。在这样的情况下,南将军却经常会在许多次战役之后询问军师小工第i号士兵到第j号士兵所有人的总军功数。请你帮助军师小工回答南将军的提问。输入只有一组测试数据第一行是三个整数N,C,Q(1<=N,C,Q<=1000000),其中N表示士兵的总数。随 阅读全文
posted @ 2012-08-09 11:51 可笑痴狂 阅读(431) 评论(0) 推荐(0) 编辑
HDOJ 1166 敌兵布阵-------------树状数组 线段树
摘要:敌兵布阵Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18120Accepted Submission(s): 7877Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数 阅读全文
posted @ 2012-08-08 22:32 可笑痴狂 阅读(560) 评论(0) 推荐(0) 编辑
POJ 2777 Count Color ---线段树
摘要:Count ColorTime Limit : 2000/1000ms (Java/Other)Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 6Accepted Submission(s) : 1Problem DescriptionChosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. T 阅读全文
posted @ 2012-08-08 18:58 可笑痴狂 阅读(1334) 评论(0) 推荐(1) 编辑
POJ 1125 Stockbroker Grapevine 弗洛伊德算法
摘要:Stockbroker GrapevineTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 21012Accepted: 11402DescriptionStockbrokers 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 th 阅读全文
posted @ 2012-08-08 15:54 可笑痴狂 阅读(1426) 评论(0) 推荐(0) 编辑
POJ 2492 A Bug's Life (并查集应用的扩展)
摘要:A Bug's LifeTime Limit: 10000MSMemory Limit: 65536KTotal Submissions: 21637Accepted: 7056DescriptionBackground Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite g 阅读全文
posted @ 2012-08-08 11:26 可笑痴狂 阅读(3683) 评论(0) 推荐(0) 编辑
POJ 1703 Find them, Catch them(并查集的扩展应用)
摘要:Find them, Catch themTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 21755Accepted: 6471DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to identify 阅读全文
posted @ 2012-08-08 11:06 可笑痴狂 阅读(334) 评论(0) 推荐(0) 编辑
POJ 1135 Domino Effect 最短路径+枚举
摘要:Domino EffectTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 5539Accepted: 1396DescriptionDid you know that you can use domino bones for other things besides playing Dominoes? Take a number of dominoes and build a row by standing them on end with only a small distance in between. If you do 阅读全文
posted @ 2012-08-07 20:07 可笑痴狂 阅读(741) 评论(0) 推荐(0) 编辑
POJ 2387 Til the Cows Come Home --单源最短路径
摘要:Til the Cows Come HomeTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 21302Accepted: 7090DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants 阅读全文
posted @ 2012-08-07 20:03 可笑痴狂 阅读(2707) 评论(0) 推荐(1) 编辑
BOJ 1257 Jim 和 Tradia的故事II-第K小数---初学线段树
摘要:/* 功能Function Description: BOJ 1257 Jim 和 Tradia的故事II-第K小数---初学线段树 开发环境Environment: DEV C++ 4.9.9.1 技术特点Technique: 版本Version: 作者Author: 可笑痴狂 日期Date: 20120807 备注Notes: Description Tradia对数据结构很感兴趣,她懂得很多有用的数据结构,比如链表、二叉树、图等等。最近她在学习堆的有关知识,并对... 阅读全文
posted @ 2012-08-07 11:01 可笑痴狂 阅读(494) 评论(0) 推荐(0) 编辑
NYOJ -123 士兵杀敌(四)
摘要:士兵杀敌(四)时间限制:2000 ms | 内存限制:65535 KB难度:5描述南将军麾下有百万精兵,现已知共有M个士兵,编号为1~M,每次有任务的时候,总会有一批编号连在一起人请战(编号相近的人经常在一块,相互之间比较熟悉),最终他们获得的军功,也将会平分到每个人身上,这样,有时候,计算他们中的哪一个人到底有多少军功就是一个比较困难的事情,军师小工的任务就是在南将军询问他某个人的军功的时候,快速的报出此人的军功,请你编写一个程序来帮助小工吧。假设起始时所有人的军功都是0.输入只有一组测试数据。每一行是两个整数T和M表示共有T条指令,M个士兵。(1<=T,M<=1000000)随 阅读全文
posted @ 2012-08-07 08:24 可笑痴狂 阅读(454) 评论(0) 推荐(0) 编辑
POJ 2359 Questions
摘要:QuestionsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 1096Accepted: 394DescriptionHolding a collegiate programming contest is a very exhausting work. There is a well-known proverb that one fool can ask so many questions that a hundred clever men will not answer. And during a collegiate p 阅读全文
posted @ 2012-08-06 09:15 可笑痴狂 阅读(387) 评论(0) 推荐(0) 编辑
NYOJ 257 郁闷的C小加(一)
摘要:郁闷的C小加(一)时间限制:1000 ms | 内存限制:65535 KB难度:3描述我们熟悉的表达式如a+b、a+b*(c+d)等都属于中缀表达式。中缀表达式就是(对于双目运算符来说)操作符在两个操作数中间:num1 operand num2。同理,后缀表达式就是操作符在两个操作数之后:num1 num2 operand。ACM队的“C小加”正在郁闷怎样把一个中缀表达式转换为后缀表达式,现在请你设计一个程序,帮助C小加把中缀表达式转换成后缀表达式。为简化问题,操作数均为个位数,操作符只有+-*/ 和小括号。输入第一行输入T,表示有T组测试数据(T<10)。每组测试数据只有一行,是一个长 阅读全文
posted @ 2012-08-05 21:10 可笑痴狂 阅读(342) 评论(0) 推荐(0) 编辑
POJ-1521 Entropy 赫夫曼编码
摘要:EntropyTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 3314Accepted: 1323DescriptionAn entropy encoder is a data encoding method that achieves lossless data compression by encoding a message with "wasted" or "extra" information removed. In other words, entropy encoding r 阅读全文
posted @ 2012-08-04 13:26 可笑痴狂 阅读(1035) 评论(0) 推荐(0) 编辑
NYOJ-128前缀式计算
摘要:前缀式计算时间限制:1000 ms | 内存限制:65535 KB难度:3描述先说明一下什么是中缀式:如2+(3+4)*5这种我们最常见的式子就是中缀式。而把中缀式按运算顺序加上括号就是:(2+((3+4)*5))然后把运算符写到括号前面就是+(2 *( +(3 4) 5) )把括号去掉就是:+ 2 * + 3 4 5最后这个式子就是该表达式的前缀表示。给你一个前缀表达式,请你计算出该前缀式的值。比如:+ 2 * + 3 4 5的值就是 37输入有多组测试数据,每组测试数据占一行,任意两个操作符之间,任意两个操作数之间,操作数与操作符之间都有一个空格。输入的两个操作数可能是小数,数据保证输入的 阅读全文
posted @ 2012-08-04 13:13 可笑痴狂 阅读(583) 评论(0) 推荐(0) 编辑
NYOJ-305 表达式求值
摘要:表达式求值时间限制:3000 ms | 内存限制:65535 KB难度:3描述Dr.Kong设计的机器人卡多掌握了加减法运算以后,最近又学会了一些简单的函数求值,比如,它知道函数min(20,23)的值是20,add(10,98)的值是108等等。经过训练,Dr.Kong设计的机器人卡多甚至会计算一种嵌套的更复杂的表达式。假设表达式可以简单定义为:1.一个正的十进制数x是一个表达式。2.如果x和y是表达式,则函数min(x,y)也是表达式,其值为x,y中的最小数。3.如果x和y是表达式,则函数max(x,y)也是表达式,其值为x,y中的最大数。4.如果x和y是表达式,则函数add(x,y)也是 阅读全文
posted @ 2012-08-03 22:18 可笑痴狂 阅读(1437) 评论(0) 推荐(0) 编辑
POJ-1047 Round and Round We Go
摘要:Round and Round We GoTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 10483Accepted: 4802DescriptionA cyclic number is an integer n digits in length which, when multiplied by any integer from 1 to n, yields a"cycle"of the digits of the original number. That is, if you consider the 阅读全文
posted @ 2012-08-03 19:33 可笑痴狂 阅读(1015) 评论(0) 推荐(0) 编辑
POJ -3253 Fence Repair
摘要:Fence RepairTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 15706Accepted: 4998DescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer length Li (1 ≤ Li ≤ 阅读全文
posted @ 2012-08-03 17:22 可笑痴狂 阅读(3232) 评论(0) 推荐(0) 编辑
二叉树的层次遍历
摘要:1751: E: ExpressionsTime Limit: 2000 ms Memory Limit: 10000 kB Total Submit : 86(18 users)Accepted Submit : 14(13 users)Page View : 2351Font Style: Aa Aa Aa Arithmetic expressions are usually written with the operators in between the two operands (which is called infix notation). For example, (x+y). 阅读全文
posted @ 2012-08-03 16:19 可笑痴狂 阅读(484) 评论(0) 推荐(0) 编辑
赫夫曼编码
摘要:/* 功能Function Description: 赫夫曼编码---正误待验证(调试时候感觉有地方好像出错了) 开发环境Environment: DEV C++ 4.9.9.1 技术特点Technique: 版本Version: 作者Author: 可笑痴狂 日期Date: 20120803 备注Notes: 作用: 输入大写字母组成的字符串,然后以其出现的次数为权重进行编码*/#include<iostream>#incl... 阅读全文
posted @ 2012-08-03 11:26 可笑痴狂 阅读(405) 评论(0) 推荐(0) 编辑
NYOJ-35 表达式求值
摘要:表达式求值时间限制:3000 ms | 内存限制:65535 KB难度:4描述ACM队的mdd想做一个计算器,但是,他要做的不仅仅是一计算一个A+B的计算器,他想实现随便输入一个表达式都能求出它的值的计算器,现在请你帮助他来实现这个计算器吧。比如输入:“1+2/4=”,程序就输出1.50(结果保留两位小数)输入第一行输入一个整数n,共有n组测试数据(n<10)。每组测试数据只有一行,是一个长度不超过1000的字符串,表示这个运算式,每个运算式都是以“=”结束。这个表达式里只包含+-*/与小括号这几种符号。其中小括号可以嵌套使用。数据保证输入的操作数中不会出现负数。数据保证除数不会为0输出 阅读全文
posted @ 2012-08-02 23:57 可笑痴狂 阅读(1033) 评论(0) 推荐(0) 编辑
NYOJ-366 D的小L 全排列
摘要:D的小L时间限制:4000 ms | 内存限制:65535 KB难度:2描述 一天TC的匡匡找ACM的小L玩三国杀,但是这会小L忙着哩,不想和匡匡玩但又怕匡匡生气,这时小L给匡匡出了个题目想难倒匡匡(小L很D吧),有一个数n(0<n<10),写出1到n的全排列,这时匡匡有点囧了,,,聪明的你能帮匡匡解围吗?输入第一行输入一个数N(0<N<10),表示有N组测试数据。后面的N行输入多组输入数据,每组输入数据都是一个整数x(0<x<10)输出按特定顺序输出所有组合。特定顺序:每一个组合中的值从小到大排列,组合之间按字典序排列。样例输入223样例输出1221123 阅读全文
posted @ 2012-08-02 20:58 可笑痴狂 阅读(497) 评论(0) 推荐(0) 编辑
POJ-3250 Bad Hair Day 单调栈
摘要:Bad Hair DayTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 10300Accepted: 3458DescriptionSome of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can see the top 阅读全文
posted @ 2012-08-02 11:17 可笑痴狂 阅读(1735) 评论(0) 推荐(1) 编辑
POJ-1028 Web Navigation
摘要:Web NavigationTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 23885Accepted: 10653DescriptionStandard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features is to use two stacks to keep track of the pages that can be 阅读全文
posted @ 2012-08-02 09:13 可笑痴狂 阅读(2756) 评论(0) 推荐(0) 编辑
NYOJ-129 树的判定
摘要:树的判定时间限制:1000 ms | 内存限制:65535 KB难度:4描述A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties.There is exactly one node, called the root, to which no directed edges 阅读全文
posted @ 2012-08-01 18:55 可笑痴狂 阅读(341) 评论(0) 推荐(0) 编辑
TOJ-3072 Train Order
摘要:Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 313 Accepted Runs: 160There is a railway station in PopPush City (See the picture below). All the trains arriving from A are numbered 1,2,3,...N. The station is dead-end, and some trains may stop here temporarily to let the behind trains pass b 阅读全文
posted @ 2012-08-01 17:29 可笑痴狂 阅读(585) 评论(1) 推荐(0) 编辑
约瑟夫问题--猴子选大王
摘要:1 /* 2 功能Function Description: 约瑟夫问题--猴子选大王 3 开发环境Environment: DEV C++ 4.9.9.1 4 技术特点Technique: 5 版本Version: 6 作者Author: 可笑痴狂 7 日期Date: 20120801 8 备注Notes: 9 题目来源: 10 http://poj.grids.cn/practice/274611 *... 阅读全文
posted @ 2012-08-01 16:40 可笑痴狂 阅读(644) 评论(0) 推荐(0) 编辑
TOJ-1036.Rails STL-栈
摘要:1 /* 2 功能Function Description: STL-栈 TOJ-1036.Rails zoj-1259 poj-1363 3 开发环境Environment: DEV C++ 4.9.9.1 4 技术特点Technique: 5 版本Version: 6 作者Author: 可笑痴狂 7 日期Date: 20120801 8 备注Notes: 9 题目来源:10 http://acm.tju.edu.cn/to... 阅读全文
posted @ 2012-08-01 15:03 可笑痴狂 阅读(529) 评论(0) 推荐(0) 编辑
加密问题 TOJ-1547
摘要:/* 功能Function Description: 加密问题 TOJ-1547 开发环境Environment: DEV C++ 4.9.9.1 技术特点Technique: 版本Version: 作者Author: 可笑痴狂 日期Date: 20120801 备注Notes: 题目来源: http://acm.tju.edu.cn/toj/showp1547.html*/#include<stdio.h>#include<string.h> int main(... 阅读全文
posted @ 2012-08-01 10:59 可笑痴狂 阅读(157) 评论(0) 推荐(0) 编辑
TOJ-1153 将字符串中的每个单词中的字符逆转
摘要:/* 功能Function Description: 将字符串中的每个单词中的字符逆转 TOJ-1153 开发环境Environment: DEV C++ 4.9.9.1 技术特点Technique: 版本Version: 作者Author: 可笑痴狂 日期Date: 20120801 备注Notes: 题目来源: http://acm.tju.edu.cn/toj/showp1153.html*/#include<stdio.h>#include<string.h... 阅读全文
posted @ 2012-08-01 10:31 可笑痴狂 阅读(375) 评论(0) 推荐(0) 编辑
POJ-2244 约瑟夫问题
摘要:1 /* 功能Function Description: POJ-2244 约瑟夫问题 2 开发环境Environment: DEV C++ 4.9.9.1 3 技术特点Technique: 4 版本Version: 5 作者Author: 可笑痴狂 6 日期Date: 20120801 7 备注Notes: 8 题意: 9 编号为1到n,一号先出去,然后向后数第m个人再出去,求最小的m值时期最后剩余的是2号10 ... 阅读全文
posted @ 2012-08-01 09:41 可笑痴狂 阅读(576) 评论(0) 推荐(0) 编辑
POJ-1012 约瑟夫问题
摘要:/* 功能Function Description: 约瑟夫环+枚举 POJ-1012 开发环境Environment: DEV C++ 4.9.9.1 技术特点Technique: 版本Version: 作者Author: 可笑痴狂 日期Date: 20120731 备注Notes: 大致题意: 有k个坏人k个好人坐成一圈,前k个为好人(编号1~k),后k个为坏人(编号k+1~2k) 现在有一个报数m,从编号为1的人开始报数,报到m的人就要自动死去。 问... 阅读全文
posted @ 2012-08-01 09:04 可笑痴狂 阅读(1295) 评论(0) 推荐(0) 编辑


< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示