• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
T Y
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 下一页
2013年8月15日
poj 3080 Blue Jeans
摘要: DescriptionThe Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of thousands of contributors to map how the Earth was populated.As an IBM researcher, you have been tasked with writing a program that will find commonalit 阅读全文
posted @ 2013-08-15 10:20 T天天T 阅读(256) 评论(0) 推荐(0)
2013年8月13日
字典树
摘要: 又称单词查找树,Trie树,是一种树形结构,是一种哈希树的变种。典型应用是用于统计,排序和保存大量的字符串(但不仅限于字符串),所以经常被搜索引擎系统用于文本词频统计。它的优点是:利用字符串的公共前缀来节约存储空间,最大限度地减少无谓的字符串比较,查询效率比哈希表高。字典树与字典很相似,当你要查一个单词是不是在字典树中,首先看单词的第一个字母是不是在字典的第一层,如果不在,说明字典树里没有该单词,如果在就在该字母的孩子节点里找是不是有单词的第二个字母,没有说明没有该单词,有的话用同样的方法继续查找.字典树不仅可以用来储存字母,也可以储存数字等其它数据。Trie的数据结构定义:#defineMA 阅读全文
posted @ 2013-08-13 14:50 T天天T 阅读(159) 评论(0) 推荐(0)
HDOJ 1671 Phone List
摘要: 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 catalogue listed these numbers:Emergency 911Alice 97 625 999Bob 91 12 54 26In this case, it's not possible to call Bob, because the central would 阅读全文
posted @ 2013-08-13 14:47 T天天T 阅读(197) 评论(0) 推荐(0)
UVA 11401 - Triangle Counting
摘要: DescriptionProblem GTriangle CountingInput:Standard InputOutput:Standard OutputYou are givennrods of length 1, 2…, n. You have to pick any 3 of them & build a triangle. How many distinct triangles can you make? Note that, two triangles will be considered different if they have at least 1 pair of 阅读全文
posted @ 2013-08-13 10:07 T天天T 阅读(223) 评论(0) 推荐(0)
2013年8月10日
CodeForces 236B Easy Number Challenge
摘要: DescriptionLet's denoted(n)as the number of divisors of a positive integern. You are given three integersa,bandc. Your task is to calculate the following sum:Find the sum modulo1073741824(230).InputThe first line contains three space-separated integersa,bandc(1 ≤ a, b, c ≤ 100).OutputPrint a sin 阅读全文
posted @ 2013-08-10 16:53 T天天T 阅读(467) 评论(0) 推荐(0)
poj 2955 Brackets
摘要: DescriptionWe give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence,ifsis a regular brackets sequence, then (s) and [s] are regular brackets sequences, andifaandbare regular brackets sequences, thenabis a regular brackets sequence. 阅读全文
posted @ 2013-08-10 15:57 T天天T 阅读(207) 评论(0) 推荐(0)
2013年8月7日
HDU 3790 最短路径问题
摘要: Description给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。(1#include #include #define maxDis 999999999#define maxN 1005using namespace std;int road[maxN][maxN][2];int dis[maxN];. 阅读全文
posted @ 2013-08-07 15:00 T天天T 阅读(196) 评论(0) 推荐(0)
畅通工程续
摘要: Description某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组数据,请处理到文件结束。每组数据第一行包含两个正整数N和M(0#include #define maxDis 999999999using namespace std;int road[205][205];int dis[205];bool visit[205];int minLength 阅读全文
posted @ 2013-08-07 14:01 T天天T 阅读(155) 评论(0) 推荐(0)
2013年8月6日
HDU 1896 六度分离
摘要: Description1967年,美国著名的社会学家斯坦利・米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six degrees of separation)。虽然米尔格兰姆的理论屡屡应验,一直也有很多社会学家对其兴趣浓厚,但是在30多年的时间里,它从来就没有得到过严谨的证明,只是一种带有传奇色彩的假说而已。Lele对这个理论相当有兴趣,于是,他在HDU里对N个人展开了调查。他已经得到了他们之间的相识关系,现在就请你帮 阅读全文
posted @ 2013-08-06 16:55 T天天T 阅读(270) 评论(0) 推荐(0)
HDU - 2544 最短路
摘要: Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N#include #define mDis 100000using namespace std;int dis[105];//表示i点到源点的路径长度int map[105][105]; //用邻接矩阵来建立图,表示两点之间的路径长度。int visit[105]; //记录该点是否在最短路集合中int.. 阅读全文
posted @ 2013-08-06 14:53 T天天T 阅读(214) 评论(0) 推荐(0)
上一页 1 2 3 4 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3