Description A crime has been comitted: a load of grain has been taken from the barn by one of FJ's cows. FJ is trying to determine which of his C (1 <= C <= 100) cows is the culprit. Fortunately, a passing satellite took an image of his farm M (1 &l…
Description A crime has been comitted: a load of grain has been taken from the barn by one of FJ's cows. FJ is trying to determine which of his C (1 <= C <= 100) cows is the culprit. Fortunately, a passing satellite took an image of his farm M (1 &l…
http://www.lydsy.com/JudgeOnline/problem.php?id=1681 太裸了.. #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include <algorithm> #include <queue> using namespace std; #de…
1680: [Usaco2005 Mar]Yogurt factory Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 106  Solved: 74[Submit][Status][Discuss] Description The cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000)…
题目 1739: [Usaco2005 mar]Space Elevator 太空电梯 Time Limit: 5 Sec  Memory Limit: 64 MB Description The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K <= 400) differe…
一道水题WA了这么多次真是.... 统考终于完 ( 挂 ) 了...可以好好写题了... 先floyd跑出各个点的最短路 , 然后二分答案 m , 再建图. 每个 farm 拆成一个 cow 点和一个 shelter 点, 然后对于每个 farm x : S -> cow( x ) = cow( x ) 数量 , shelter( x ) -> T = shelter( x ) 容量 ; 对于每个dist( u , v ) <= m 的 cow( u ) -> shelter( v…
1740: [Usaco2005 mar]Yogurt factory 奶酪工厂 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 119  Solved: 100[Submit][Status][Discuss] Description The cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10…
1682: [Usaco2005 Mar]Out of Hay 干草危机 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 391  Solved: 258[Submit][Status] Description The cows have run out of hay, a horrible event that must be remedied immediately. Bessie intends to visit the other farms…
bzoj1682[Usaco2005 Mar]Out of Hay 干草危机 题意: 给个图,每个节点都和1联通,奶牛要从1到每个节点(可以走回头路),希望经过的最长边最短. 题解: 求最小生成树即可. 代码: #include <cstdio> #include <cstring> #include <algorithm> #include <queue> #define inc(i,j,k) for(int i=j;i<=k;i++) #defin…
bzoj1680[Usaco2005 Mar]Yogurt factory bzoj1740[Usaco2005 mar]Yogurt factory 奶酪工厂 题意: n个月,每月有一个酸奶需求量(吨)和酸奶成本(元每吨).酸奶可以保存,费用为S(元每月每吨),求最小总费用.n≤10000 题解: 第i月每吨酸奶的成本为Cj+s*(i-j),j∈[1,i],化简得Cj-s*j+s*i,因为s*i只和当前相关,所以维护一个最小的Cj-s*j即可.注意开long long. 代码: #includ…