数据结构
不为自己找借口
且随疾风前行,身后亦须留心。
展开
-
杭电 1863 畅通工程(kruscal)
Problem Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 Input测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( <原创 2015-08-12 16:26:32 · 338 阅读 · 0 评论 -
杭电 1875 畅通工程再续(kruscal)
Problem Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米原创 2015-08-12 16:23:46 · 304 阅读 · 0 评论 -
杭电 1686 Oulipo (kmp)
Oulipo The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pair normal, m原创 2015-08-07 20:43:01 · 309 阅读 · 0 评论 -
杭电 1232 畅通工程 (并查集)
Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 100原创 2015-07-29 21:00:07 · 376 阅读 · 0 评论 -
杭电 1213 hao many tables(并查集)
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 frien原创 2015-07-29 21:03:19 · 349 阅读 · 0 评论 -
poj 2406 Power Strings (kmp)
Given 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 multiplication, exponentiation by a non-原创 2015-08-07 20:45:53 · 217 阅读 · 0 评论 -
杭电 1711 Number Sequence(kmp)
Problem DescriptionGiven two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b原创 2015-08-08 17:56:00 · 325 阅读 · 0 评论 -
杭电 1022火车进站
Problem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is t原创 2015-07-28 19:49:45 · 417 阅读 · 0 评论 -
NYOJ 60 谁获得了最高奖学金(结构体)
谁获得了最高奖学金时间限制:1000 ms | 内存限制:65535 KB难度:2描述 某校的惯例是在每学期的期末考试之后发放奖学金。发放的奖学金共有五种,获取的条件各自不同: 1) 院士奖学金,每人8000元,期末平均成绩高于80分(>80),并且在本学期内发表1篇或1篇以上论文的学生均可获得; 2) 五四奖学金,每人4000元,期末平均成绩原创 2015-09-24 20:16:34 · 506 阅读 · 0 评论