首页 > TAG信息列表 > Watering

1040 [USACO 2014 Mar S]Watering the Fields 最小生成树

 链接:https://ac.nowcoder.com/acm/problem/24587来源:牛客网 题目描述 Due to a lack of rain, Farmer John wants to build an irrigation system to send water between his N fields (1 <= N <= 2000). Each field i is described by a distinct

P1550 [USACO08OCT]Watering Hole G

每个点向井连边,边权为其点权。跑MST就行力。 #include<bits/stdc++.h> using namespace std; const int maxn=1e5+5; struct edge{ int u,v,w; bool operator <(const edge &b)const{return w<b.w;} }e[maxn]; int cnt=0; int n; int fa[305]; int g[305][305]; int Find(int

C.Watering Flowers--- (贪心+暴力) Codeforces Round #340 (Div. 2)

Watering Flowers 题目链接http://codeforces.com/contest/617/problem/C time limit per test 2 seconds memory limit per test 256 megabytes 题目大意:给你两个喷泉的坐标,再给你n个点,然后让你求两个喷泉的半径使得他们能够覆盖所有点,求r12+r22的最小值; emmm,思路不歪的话就没

UVa 10382 Watering Grass (贪心 区间覆盖)

利用几何关系转化以后,变成经典的区间覆盖问题 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 10010; const double eps = 1e-11; int n, L, w; int p[maxn], r[maxn]; struct Seg{ double l, r; bool operator < (const Seg &x)

【洛谷 2212】浇地Watering the Fields

题目描述 Due to a lack of rain, Farmer John wants to build an irrigation system to send water between his N fields (1 <= N <= 2000). Each field i is described by a distinct point (xi, yi) in the 2D plane, with 0 <= xi, yi <= 1000. The cost of bui

喷水装置---Watering Grass

Watering Grass Input: standard input Output: standard output Time Limit: 3 seconds n sprinklers are installed in a horizontal strip of grass l meters long andw meters wide. Each sprinkler is installed at the horizontal center line of the strip. For each

[USACO14MAR]浇地Watering the Fields【洛谷P2212】

题目描述 Due to a lack of rain, Farmer John wants to build an irrigation system to send water between his N fields (1 <= N <= 2000). Each field i is described by a distinct point (xi, yi) in the 2D plane, with 0 <= xi, yi <= 1000. The cost of buil