1657: [Usaco2006 Mar]Mooo 奶牛的歌声
Time Limit: 5 Sec Memory Limit: 64 MB Submit: 634 Solved: 447 [Submit][Status][Discuss]
Description
Farmer John's N (1 <= N <= 50,000) cows are standing in a very straight row and mooing. Each cow has a unique height h in the range 1..2,000,000,000 nanometers (FJ really is a …
阅读更多1656: [Usaco2006 Jan] The Grove 树木
Time Limit: 5 Sec Memory Limit: 64 MB Submit: 143 Solved: 88 [Submit][Status][Discuss]
Description
The pasture contains a small, contiguous grove of trees that has no 'holes' in the middle of the it. Bessie wonders: how far is it to walk around that grove and get back to my starting …
阅读更多1655: [Usaco2006 Jan] Dollar Dayz 奶牛商店
Time Limit: 5 Sec Memory Limit: 64 MB Submit: 353 Solved: 190 [Submit][Status][Discuss]
Description
Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are selling variously for $1, $2, and $3. …
阅读更多1653: [Usaco2006 Feb]Backward Digit Sums
Time Limit: 5 Sec Memory Limit: 64 MB Submit: 349 Solved: 258 [Submit][Status][Discuss]
Description
FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list …
阅读更多tmp
2016-04-13 · 1 min read1#include <iostream> 2#include <vector> 3#include <cstring> 4#include <set> 5#include <algorithm> 6#include <cstdio>
1using namespace std; 2const int N=1E4+7; 3int n,k,Q; 4int siz; 5int pos[N]; 6int sum[N]; 7int dis[N]; 8bool vis[N]; 9vector < pair<int,int> > edge[N];
1 …
阅读更多