码迷,mamicode.com
首页 >  
搜索关键字:codeforces 91b    ( 12211个结果
Codeforces 437D The Child and Zoo(贪心+并查集)
题目链接:Codeforces 437D The Child and Zoo 题目大意:小孩子去参观动物园,动物园分很多个区,每个区有若干种动物,拥有的动物种数作为该区的权值。然后有m条路,每条路的权值为该条路连接的两个区中权值较小的一个。如果两个区没有直接连接,那么f值即为从一个区走到另一个区中所经过的路中权值最小的值做为权值。问,平均两个区之间移动的权值为多少。 解题思路:并查集+...
分类:其他好文   时间:2014-06-15 15:12:33    阅读次数:157
Codeforces 437E The Child and Polygon(区间DP)
题目链接:Codeforces 437E The Child and Polygon 题目大意:给出一个多边形,问说有多少种分割方法,将多边形分割为多个三角形。 解题思路:首先要理解向量叉积的性质,一开始将给出的点转换成顺时针,然后用区间dp计算。dp[i][j]表示从点i到点j可以有dp[i][j]种切割方法。然后点i和点j是否可以做为切割线,要经过判断,即在i和j中选择的话点k的话...
分类:其他好文   时间:2014-06-15 10:31:02    阅读次数:209
Codeforces Round #249 (Div. 2) A. Black Square
水题#include #include #include using namespace std;int main(){ vector a(4); cin >> a[0] >> a[1]>>a[2]>>a[3]; string str; cin >> str; int res = 0; for(in...
分类:其他好文   时间:2014-06-14 23:00:14    阅读次数:249
Codeforces Round #247 (Div. 2) B - Shower Line
模拟即可#include #include #include using namespace std;int main(){ vector a(5); for(int i = 0; i > g[i][j]; } } int maxHappiness = 0; ...
分类:其他好文   时间:2014-06-14 22:57:10    阅读次数:207
Codeforces Round #249 (Div. 2) B. Pasha Maximizes
看到题目的时候,以为类似插入排序,比较第i个元素和第i-1个元素,如果第i个元素比第i-1个元素小,则不交换如果第i个元素比第i-1个元素大,则交换第i个元素和第i-1个元素 继续比较第i-1个元素与前一个元素,直到前一个元素大为止交换元素次大于等于k则停止但对测试用例1234 3则出现问题,如果....
分类:其他好文   时间:2014-06-14 21:46:18    阅读次数:191
Codeforces Round #245 (Div. 2) A - Points and Segments (easy)
水到家了#include #include #include using namespace std;struct Point{ int index, pos; Point(int index_ = 0, int pos_ = 0){ index = index_; ...
分类:其他好文   时间:2014-06-14 21:21:40    阅读次数:281
看个人思路吧,清晰的话就简单 CodeForces 271A - Beautiful Year
It seems like the year of 2013 came only yesterday. Do you know a curious fact? The year of 2013 is the first year after the old 1987 with only distin...
分类:其他好文   时间:2014-06-14 19:10:14    阅读次数:232
Codeforces Round #245 (Div. 2) B - Balls Game
暴利搜索即可#include #include #include using namespace std;int main(){ int n,k,x; cin >> n >> k >> x; vector c(n); for(int i = 0 ; i > c[i]; ...
分类:其他好文   时间:2014-06-14 18:47:42    阅读次数:206
Zepto Code Rush 2014——Dungeons and Candies
k个点,每个点都是一个n * m的char型矩阵。对与每个点,权值为n * m或者找到一个之前的点,取两个矩阵对应位置不同的字符个数乘以w。找到一个序列,使得所有点的权值和最小...
分类:其他好文   时间:2014-06-14 14:09:30    阅读次数:238
Codeforces Zepto Code Rush 2014 Feed with Candy 贪心
Codeforces Zepto Code Rush 2014 Feed with Candy 贪心 题解 一开始想的很native,就是想简单贪心排一下序去搞。。。然后玩脱了。。。先是无脑WA8,后来好不容易过了就被适牛hack了。。。 正解是,每次选取所有可能的糖果中,质量最大的那个。 具体实现的时候可以用优先队列去维护。...
分类:其他好文   时间:2014-06-14 09:26:27    阅读次数:257
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!