http://codeforces.com/gym/100623/attachments H题已经给出来的,包括后来添加的,都累加得到ans,那么从1-ans都是可以凑出来的,如果ans<a[now]-1,那么就添加一个ans+1,然后继续操作. #include<iostream> #include<cstdio> #include<queue> #include<algorithm> #include<cmath> #include&l…
http://codeforces.com/gym/100623/attachments E题第一个优化它虽然是镜像对称,但它毕竟是一一对称的,所以可以匹配串和模式串都从头到尾颠倒一下第二个优化,与次数无关,所以排个序就完事了 #include<iostream> #include<cstdio> #include<queue> #include<algorithm> #include<cmath> #include<ctime> #…
Problem H. Hard TestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description Andrew is having a hard time preparing his 239-th contest for Petrozavodsk. This time the solution to the problem is based on Di…
Problem G. Grave 题目连接: http://codeforces.com/gym/100531/attachments Description Gerard develops a Halloween computer game. The game is played on a rectangular graveyard with a rectangular chapel in it. During the game, the player places new rectangul…
Problem H. Hiking in the Hills 题目连接: http://codeforces.com/gym/100531/attachments Description Helen is hiking with her friends in a highland. Their plan is to hike from their camp A to a beautiful showplace B. Unfortunately, Helen started feeling diz…
题目大意: https://codeforces.com/gym/102012/problem/H?csrf_token=c9d0191a64a241166d54a565b1615125 区间[l , r] 中有n条线 问用k种颜色最多能染多少区间  并输出区间和r - l: ∑n <= 2e6,1 <= k <= 2e5,0 <= l < r <= 1e9. 解题思路: 把N*2 个端点排序, 对端点和颜色进行入队出队操作 当颜色为空时说明这个区间满足要求,并将此线段…
Problem H. Horrible Truth Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100610 Description In a Famous TV Show “Find Out” there are n characters and only one Horrible Truth. To make the series breathtaking all way long, the sc…
题目地址 先简单的总结一下这次CF,前两道题非常的水,可是第一题又是因为自己想的不够周到而被Hack了一次(或许也应该感谢这个hack我的人,使我没有最后在赛后测试中WA).做到C题时看到题目情况非常复杂,明显超出自己现在水平,卡了很久也没有好好做题.等了很长时间才开始看D题,而这时信心已经严重不足.赛后再看D题才发现自己比赛时理解错了题意,致使误以为题目非常复杂.而实际上,这个过程分析起来是非常容易的. 对于三种棱长度分别为a,b,c的石头,r最大为min(a,b,c)/2;. 如果两个石头要…
Codeforces 828B Black Square(简单题) Description Polycarp has a checkered sheet of paper of size n × m. Polycarp painted some of cells with black, the others remained white. Inspired by Malevich's "Black Square", Polycarp wants to paint minimum pos…
http://codeforces.com/gym/100240 J [分析] 这题我搞了好久才搞出样例的11.76....[期望没学好 然后好不容易弄成分数形式.然后我‘+’没打..[于是爆0... 好桑心.. 对于x^2这样的期望,是不能直接求x的期望然后平方的! 为什么呢?因为意义就是不对的,你的概率有可能乘了两次什么的... 我的方法是: 先把每天分离出来,对于某一天,假设你前i部番的x^2的期望求了出来,然后新的一部翻在这天放的概率是p, 新的答案就是$x^{2}*(1-p)+p*(x…