NC24438 [USACO 2016 Ope P]262144】的更多相关文章

NC24017 [USACO 2016 Jan S]Angry Cows 题目 题目描述 Bessie the cow has designed what she thinks will be the next big hit video game: "Angry Cows". The premise, which she believes is completely original, is that the player shoots cows with a slingshot i…
NC25136 [USACO 2006 Ope B]Cows on a Leash 题目 题目描述 给定如图所示的若干个长条.你可以在某一行的任意两个数之间作一条竖线,从而把这个长条切开,并可能切开其他长条.问至少要切几刀才能把每一根长条都切开.样例如图需要切两刀. 注意:输入文件每行的第一个数表示开始的位置,而第二个数表示长度. 输入描述 Line \(1\) : A single integer, \(N\) (\(2 <= N <= 32000\)) Lines \(2 \cdots N…
1.Splitting the Field http://usaco.org/index.php?page=viewproblem2&cpid=645 给二维坐标系中的n个点,求ans=用一个矩形覆盖所有点所用矩形面积-用两个矩形覆盖所有点所用两个矩形的最小面积和,而且两个矩形不能重合(边重合也不行) 枚举两个矩形的分割线,也就是把所有点分成两个部分,枚举分割点:先预处理每个点之前和之后的最大,最低高度 #include<algorithm> #include<cstdio>…
1.Circular Barn   http://www.usaco.org/index.php?page=viewproblem2&cpid=621 贪心 #include <cstdio> #include <vector> #include <algorithm> #include <cstring> using namespace std; long long sum(long long v) { )*(*v+)/; } int main()…
1.Angry Cows http://www.usaco.org/index.php?page=viewproblem2&cpid=597 dp题+vector数组运用 将从左向右与从右向左扫描结合.先从左到右DP,确定每个干草捆向右爆炸的最小半径,再从右到左,确定每个干草捆向左爆炸的最小半径.通过扫描每个干草捆,用这两个数字来确定我们应该设置初始引爆点的最佳位置. #include <cstdio> #include <algorithm> #include <v…
题目大意:平面上一堆点,用两条平行于坐标轴的直线将其分为四部分,使得点数最多的一部分最少 第一维枚举,第二维三分,点集用两棵树状数组维护 #include<bits/stdc++.h> #define maxn 100010 using namespace std; inline int read(){ ;char ch=getchar(); ';ch=getchar()); +ch-'; return s; } int n; struct node{ int x,y; int cntx,cn…
Link: 传送门 A: 贪心从小到大插入,用并查集维护连通性 #include <bits/stdc++.h> using namespace std; #define X first #define Y second typedef double db; typedef long long ll; typedef pair<int,int> P; ; int n,tot,cnt,f[MAXN];P dat[MAXN]; struct edge{int x,y;ll w;}e[M…
130. [USACO Mar08] 游荡的奶牛 ★☆   输入文件:ctravel.in   输出文件:ctravel.out   简单对比时间限制:1 s   内存限制:128 MB 奶牛们在被划分成N行M列(2 <= N <= 100; 2 <= M <= 100)的草地上游走,试图找到整块草地中最美味的牧草.Farmer John在某个时刻看见贝茜在位置(R1, C1),恰好T (0 < T <= 15)秒后,FJ又在位置(R2, C2)与贝茜撞了正着.FJ并不…
182. [USACO Jan07] 均衡队形 ★★   输入文件:lineup.in   输出文件:lineup.out   简单对比时间限制:4 s   内存限制:128 MB 题目描述 农夫约翰的 N (1 ≤ N ≤ 50,000) 头奶牛,每天挤奶时总会按同样的顺序站好.一日,农夫约翰决定为奶牛们举行一个“终极飞盘”比赛.为简化问题,他将从奶牛队列中选出一个连续区间来进行游戏.不过,参加游戏的奶牛要玩的开心的话就不能在身高上差距太大. 农夫约翰制定了 Q (1 ≤ Q ≤ 200,00…
PowMod Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1008    Accepted Submission(s): 341 Problem Description Declare:k=∑mi=1φ(i∗n) mod 1000000007 n is a square-free number. φ is the Euler's…