随笔分类 - OJ
ACM
摘要:Description Input Output Sample Input Sample Output 模拟栈算法:
阅读全文
摘要:98523032013-12-18 11:47:01Accepted13010MS264K1117 BC++泽泽Jungle RoadsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3835 Accepted Submission(s): 2797 Problem DescriptionThe Head Elder of the tropical island of Lagrishan has a problem. A burst of
阅读全文
摘要:还是畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 21620 Accepted Submission(s): 9631 Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每
阅读全文
摘要:HDOJ 题目分类//分类不是绝对的//"*" 表示好题,需要多次回味//"?"表示结论是正确的,但还停留在模块阶 段,需要理解,证明。//简单题看到就可以敲的1000: 入门用;1001: 用高斯求和公式要防溢出1004:1012:1013: 对9取余好了1017:1021:1027: 用STL中的next_permutation()1029:1032:1037:1039:1040:1056:1064:1065:1076: 闰年1084:1085:1089,1090,1091,1092,1093,1094, 1095, 1096:全是A+B1108:1
阅读全文
摘要:畅通工程再续Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 11783 Accepted Submission(s): 3596 Problem Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛
阅读全文
摘要:最短路Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 24454 Accepted Submission(s): 10531 Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N 2 #i
阅读全文
摘要:畅通工程续Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 22100 Accepted Submission(s): 7701 Problem Description某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题
阅读全文
摘要:Bus SystemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5709 Accepted Submission(s): 1449 Problem DescriptionBecause of the huge population of China, public transportation is very important. Bus is an important transportation method in traditio
阅读全文
摘要:Eddy's pictureTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5797 Accepted Submission(s): 2913 Problem DescriptionEddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his
阅读全文
摘要:Constructing RoadsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 11894 Accepted Submission(s): 4496 Problem DescriptionThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect
阅读全文
摘要:Problem 1205 小鼠迷宫问题 问题描述 小鼠a与小鼠b身处一个m×n的迷宫中,如图所示。每一个方格表示迷宫中的一个房间。这m×n个房间中有一些房间是封闭的,不允许任何人进入。在迷宫中任何位置均可沿上,下,左,右4个方向进入未封闭的房间。小鼠a位于迷宫的(p,q)方格中,它必须找出一条通向小
阅读全文
摘要:Red and BlackTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7337 Accepted Submission(s): 4591 Problem DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile.
阅读全文
摘要:小希的迷宫Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 21562 Accepted Submission(s): 6591 Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A
阅读全文
摘要:Problem DescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, and all the friends do not want to stay with strangers.One important rule
阅读全文
摘要:1 #include 2 #include 3 typedef struct node *btlink; 4 struct node 5 { 6 int data; 7 btlink left; 8 btlink right; 9 int t; 10 }; 11 12 btlink BT; 13 void insert(btlink q, i...
阅读全文
摘要:归并排序(MERGE-SORT)是利用归并的思想实现的排序方法,该算法采用经典的分治(divide-and-conquer)策略(分治法将问题分(divide)成一些小的问题然后递归求解,而治(conquer)的阶段则将分的阶段得到的各答案"修补"在一起,即分而治之)。 归并排序是稳定排序,它也是一
阅读全文