最小-最大-生成树
楚江枫
不忘初心,方得始终
展开
-
【POJ 2485 Highways】
HighwaysDescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this pr原创 2016-08-03 21:49:31 · 317 阅读 · 0 评论 -
【HDU 1863 畅通工程】
畅通工程Problem Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。Input 测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( < 100 );原创 2016-08-19 21:21:58 · 386 阅读 · 0 评论 -
【POJ 2377 Bad Cowtractors】
Bad CowtractorsDescriptionBessie has been hired to build a cheap internet network among Farmer John’s N (2 <= N <= 1,000) barns that are conveniently numbered 1..N. FJ has already done some surveying,原创 2016-08-10 09:25:58 · 335 阅读 · 0 评论 -
【HDU 5253 连接的管道】
连接的管道Problem Description 老 Jack 有一片农田,以往几年都是靠天吃饭的。但是今年老天格外的不开眼,大旱。所以老 Jack 决定用管道将他的所有相邻的农田全部都串联起来,这样他就可以从远处引水过来进行灌溉了。当老 Jack 买完所有铺设在每块农田内部的管道的时候,老 Jack 遇到了新的难题,因为每一块农田的地势高度都不同,所以要想将两块农田的管道链接,老 Jack 就需原创 2016-08-24 21:36:20 · 445 阅读 · 0 评论 -
【zzulioj 1900 985的“树”难题】
1900: 985的“树”难题Description985给你一棵“树”以及它的根节点,要求你先判定它是否是一棵树,其次他想知道每个节点的“太子”数目以及它的父亲(root的话输出自己)。 “太子判定条件”: 一、若x是y的孩子节点,那么x是y的“太子”; 二、若x是y的“太子”且y是z的“太子”,那么x是z的“太子”。 Input第一行输入一个整数t,代表有t组测试数据。 每组数据第一行原创 2016-09-08 15:48:07 · 471 阅读 · 0 评论 -
【HDU 2196 】+ 直径 + 权值更新
Problem Description A school bought the first computer some time ago(so this computer’s id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one of原创 2016-10-02 22:16:54 · 524 阅读 · 0 评论 -
【HPU 1409: Watch Dog [最小生成树]】
1409: Watch Dog [最小生成树] 时间限制: 1 Sec 内存限制: 128 MB提交: 47 解决: 15 统计 题目描述 在2050年某城市,一个神秘组织通过一种名叫ctOS的控制系统掌控了全城所有人的联网设备(手机、电脑、监控、交通信号灯,甚至是银行警察局的安保系统),该系统通过很多遍布城市各地的基站来完成对电子设备的控制。Aiden Pearce(艾登·皮尔斯)是一名超级原创 2017-08-11 18:08:52 · 355 阅读 · 0 评论 -
【UVA 10397 Connect the Campus】& 最小生成树 & Kruskal
Many new buildings are under construction on the campus of the University of Waterloo. The university has hired bricklayers, electricians, plumbers, and a computer programmer. A computer programmer?原创 2017-10-11 21:32:45 · 288 阅读 · 0 评论 -
【UVA 10034 Freckles】& Kruskal & 最小生成树
In an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad’s back to form a picture of the Liberty Bell. Alas, one of the freckles turns out to be a scar, so his Ripley’s原创 2017-10-11 22:28:32 · 342 阅读 · 0 评论