![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Codeforces
dezhonger
这个作者很懒,什么都没留下…
展开
-
codeforces 1312E Array Shrinking
给了一组数,每次可以选择两个相邻且相等的数x替换为x+1,问最后能得到的最少的数的个数 区间dp: dp[i][j]表示区间[i,i+1..j]能得到的最少数的个数,f[i][j]表示对应的值是多少,转移方程如下 dp[i][j] =min(dp[i][j],dp[i][k] + dp[k+1][j]) if (dp[i][k] == 1 && dp[k+1]...原创 2020-03-11 21:17:50 · 162 阅读 · 0 评论 -
codeforces educational round 66
https://codeforces.com/contest/1175 https://codeforces.com/contest/1175/standings A:From Hero to Zero 题意:一个数k,每次可以减1,或者除以k(只有当被k整除的时候),求变为0的次数,贪心 B:Catch Overflow!相当于给了一个for的伪代码,求最后结果,结果大于 1<...原创 2019-06-11 20:41:24 · 153 阅读 · 0 评论 -
Codeforces Round #565 div3
https://codeforces.com/contest/1176 https://codeforces.com/contest/1176/standings A: Divide it! 题意:每个数可以n/2, 2n/3, 3n/5,求变为1的最小次数,不行的话输出-1 贪心 B:Merge it! 题意:一个数组,可以选泽把两个数求和后合并为一个数,求最多的能被3...原创 2019-06-10 22:51:34 · 224 阅读 · 0 评论 -
Codeforces Round #560 div3
题目:https://codeforces.com/contest/1165 题解:https://codeforces.com/blog/entry/67041 A,B:略过 C:定义一个字符串是good,如果满足 1:长度是偶数 2:对每个奇数位置满足s[i] != s[i+1](1-base) 问最少删除几个字符可以使原字符串是good 分析:贪心,可以看代码 ...原创 2019-05-16 00:04:14 · 135 阅读 · 0 评论 -
Codeforces Round #557 div2
题目:https://codeforces.com/contest/1162 题解:https://codeforces.com/blog/entry/66878 代码:https://github.com/dezhonger/Algorithm/tree/master/codeforces/round557%20div2 A.Zoning Restrictions Again 题意:给...原创 2019-05-06 12:40:10 · 310 阅读 · 1 评论 -
Codeforces Round #551
大概题意:每个非叶子节点有一个标记(max or min)表示取子节点的最大值或最小值,假设有x个叶子,我们给叶子节点分配1-x的值,求根节点最大值为多少。 http://codeforces.com/contest/1153/problem/D 做法: dp[i]表示节点i可以取到的最大值,我们用1表示可以取到最大值,2表示可以取到次大值 j是i的子节点 假设i是max,d...原创 2019-04-14 14:07:00 · 265 阅读 · 0 评论 -
codeforces global round 2
A 题意:给一组数,求两个不同的数的最大距离(保证至少有两个数不同) 最大的两个数位a[i]和a[j],至少有一个在两端。贪心即可 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >...原创 2019-04-08 23:45:00 · 78 阅读 · 0 评论 -
cf276 div2
A:给了两个数a和m,当天需要再生产a%m个产品,如果s原创 2014-11-06 17:22:47 · 422 阅读 · 0 评论 -
codeforce 39 J
题目链接:http://codeforces.com/problemset/problem/39/J 给了liang原创 2014-09-01 15:22:36 · 641 阅读 · 0 评论 -
Codeforces Round #263 (Div. 2)
官方题解:http://codeforces.com/blog/entry/13568 题目lia原创 2014-08-28 16:35:45 · 495 阅读 · 0 评论 -
Codeforces Round #263 (Div. 1)
http://codeforces.com/contest/461原创 2014-08-28 16:43:33 · 402 阅读 · 0 评论 -
CodeForce Round 257 div2
A. Jzzhu and Children time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n children in Jzzhu's school原创 2014-07-26 05:13:01 · 842 阅读 · 0 评论 -
CF round 259
A. Little Pony and Crystal Mine time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle once got a原创 2014-08-20 16:15:59 · 605 阅读 · 0 评论 -
CodeForce Round 257 div1
官方题解 :http://codeforces.com/blog/entry/13112 前三个原创 2014-07-26 05:21:21 · 554 阅读 · 0 评论 -
CodeForce Round 258 div2
官方题解 http://codeforces.com/blog/entry/13181原创 2014-07-25 05:28:25 · 847 阅读 · 0 评论