Codeforces 833E Caramel Clouds】的更多相关文章

E. Caramel Clouds time limit per test:3 seconds memory limit per test:256 megabytes input:standard input output:standard output It is well-known that the best decoration for a flower bed in Sweetland are vanilla muffins. Seedlings of this plant need…
[CF833E]Caramel Clouds(线段树) 题面 CF 洛谷 题解 首先把区间一段一段分出来,那么只有四种情况. 要么没有被任何一朵云被覆盖,那么直接就会产生这一段的贡献. 要么被一朵云覆盖,要么被两朵云覆盖. 要么被三朵及以上的云所覆盖,那么这段的贡献永远取不到. 对于每朵云预处理出只被其覆盖的区间长度\(len[i]\),这样子就能处理只选择一朵云的贡献了. 现在考虑如何处理选择两朵云. 这里有两种情况. 第一种是两朵云无交,那么贡献就是\(len[i]+len[j]\). 否则…
[CF833E]Caramel Clouds 题面 洛谷 题目大意: 天上有\(n\)朵云,每朵云\(i\)会在时间\([li,ri]\)出现,你有\(C\)个糖果,你可以花费\(c_i\)个糖果让云\(i\)消失,同时需要保证你最多让两朵云消失.现在有\(m\)个独立的询问,每次给你一个需要让阳光照\(k\)时间的植 物,问你从时刻\(0\)开始,这个植物最快什么时候能长成. \(n,m\leq 3e5\) 题解 这题好神仙啊... 我们首先记几个东西: \(Free:\)表示当前空着的长度和…
题面 天上有$n$朵云,每朵云$i$会在时间$[l_i,r_i]$出现,你有$\text C$个糖果,你可以花费$c_i$个糖果让云$i$消失,同时需要保证你最多让两朵云消失.现在有$m$个独立的询问,每次给你一个需要让阳光照$k$时间的植物,问你从时刻$0$开始,这个植物最快什么时候能长成. $n,m\leq 3\times10^5$ 题解 神仙$blog$ 看他的吧,这题真的麻烦. 代码 #include<cstdio> #include<cstring> #include&l…
1. 833A The Meaningless Game 大意: 初始分数为$1$, 每轮选一个$k$, 赢的人乘$k^2$, 输的人乘$k$, 给定最终分数, 求判断是否成立. 判断一下$a\cdot b$是否是立方数, 以及能否被那个立方的因子整除即可. cbrt竟然有误差, 特判了一下, 好坑 #include <iostream> #include <sstream> #include <algorithm> #include <cstdio> #i…
Problem F. Door LockTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/attachments Description It was a beautiful night at Yekaterinburg, the sky was crystal clear with no clouds, and the view of the moon and the stars was…
A. The Useless Toy time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which…
题目链接:http://codeforces.com/contest/436/problem/A 题目意思:给出 n 颗只有两种类型:fruit 和 caramel的candies,这些candies是挂在屋子上的,对于第 i 颗candy,它离地面为 hi 厘米,质量为 mi:有只叫Om Nom的怪兽想尽可能地把这些candy吃光,它初始的时候只能跳 x 的高度,如果有某颗或者一些candy离地面的距离 <= x,就代表Om Nom可以吃掉,吃掉之后它下一次可以跳的高度会变成 x + mi(m…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…