![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
cf
文章平均质量分 69
19992144
这个作者很懒,什么都没留下…
展开
-
100248A
这是个dp。被老师批评了。。。看书不认真。。。只会看答案。。。 怎么dp呢? dp[i]:到i元钱的步数 从左往右更新:dp[i]=dp[i-a[i]]+1 min() 为什么不从i-a[i],i-2*a[i],i-3*a[i]更新呢? 因为如果i-a[i]能更新,证明当前最优,如果i-2*a[i]也是最优,并没有什么意义 因为。。。 再从右往左更新 #include #inclu原创 2016-09-11 20:04:43 · 250 阅读 · 0 评论 -
11C
C. How Many Squares? time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output You are given a 0-1 rectangular matrix. What is t原创 2016-09-15 19:52:31 · 971 阅读 · 0 评论 -
gym 100484
贪心,mr很久以前讲过,但是忘了。 跟国王游戏很像,都是贪心,并且是两个东西,一个是乘法,一个是加法. 贪心w+s,因为...推出来的 #include #include using namespace std; typedef long long ll; ll n,ans,tot; ll c[100010],w[100010],s[100010]; bool cp(ll x,ll y)原创 2016-09-06 20:10:09 · 307 阅读 · 0 评论 -
100484H
按右端点排序。因为我们尽量选用重合最多的点。而最左边的右端点相对于这一段是最好的,因为他可能的重合数最多,因为越往右,接触到的线段越多,重复数也越多。 因此对右端点排序,然后从一段右端点向左端点扫描,标记。 #include #include #include using namespace std; const int inf=10001; typedef pair PII; vectorv原创 2016-09-07 18:59:00 · 226 阅读 · 0 评论