CODEFORCES-PROBLEMSET】的更多相关文章

题目链接: http://codeforces.com/gym/100851 题目大意: N个人,每个人有pi个物品,每个物品价值为0~49.每次从1~n顺序选当前这个人的物品,如果这个物品的价值>=之前所有物品价值和则加上这个物品,否则这个物品舍弃不计算在内. 总共拿出K个物品,如果一个人没物品拿了那么他会拿出价值为50的物品.求最终物品价值和有多少. 题目思路: [模拟] 直接暴力枚举.判断是否超过之前的总和,如果有人拿了50则后面的人肯定都是拿50. // //by coolxxx //#…
虽然一开始就觉得从右下角左上角直接dp2次是不行的,后面还是这么写了WA了 两次最大的并不一定是最大的,这个虽然一眼就能看出,第一次可能会影响第二次让第二次太小. 这是原因. 5 4 32 1 18 41 47 38 7 43 43 48 23 39 40 23 26 39 33 5 36 31 29 7 26 47 这组数据是结果. 走完第一遍成 0 32 1 18 41 0 38 7 43 43 0 0 0 0 0 26 39 33 5 0 31 29 7 26 0 这样倒着走回去一定会经过…
E. Packmen time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells - asterisks, other cells are empty.…
A. Warrior and Archer time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output In the official contest this problem has a different statement, for which jury's solution was working incorrectly, and…
D. Memory and Scores time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Memory and his friend Lexa are competing to get higher score in one popular computer game. Memory starts with score a a…
D. Queue time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little girl Susie went shopping with her mom and she wondered how to improve service quality. There are n people in the queue. For e…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概率是在正面,各个卡牌独立.求把所有卡牌来玩Nim游戏,先手必胜的概率. (⊙o⊙)-由于本人只会在word文档里写公式,所以本博客是图片格式的. Code #include <cstdio> #include <cstring> #include <algorithm> u…
http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连通图)且这颗树中必须包含节点1 然后将这颗子树中的所有点的点权+1或-1 求把所有点权全部变为0的最小次数(n<=10^5) 题解: 因为每一次的子树中都必须有1,所以我们得知每一次变换的话1的权值都会变化 所以我们以1为根 现在,我们发现,如果一个节点的权值发生变化,那么他的父节点的权值一定发生变…
http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a3-+ai,问满足Si<=p的i的最大值的期望.(p<=50) (大意来自于http://www.cnblogs.com/liu-runda/p/6253569.html) 我们知道,全排列其实等价于我们一个一个地等概率地向一个序列里面插入数值 所以我们可以这么看这道题: 现在有n个数,有n个盒子…