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 · 157 阅读 · 0 评论 -
codeforces educational round 66
https://codeforces.com/contest/1175https://codeforces.com/contest/1175/standingsA:From Hero to Zero题意:一个数k,每次可以减1,或者除以k(只有当被k整除的时候),求变为0的次数,贪心B:Catch Overflow!相当于给了一个for的伪代码,求最后结果,结果大于 1<...原创 2019-06-11 20:41:24 · 149 阅读 · 0 评论 -
Codeforces Round #565 div3
https://codeforces.com/contest/1176https://codeforces.com/contest/1176/standingsA: Divide it!题意:每个数可以n/2, 2n/3, 3n/5,求变为1的最小次数,不行的话输出-1贪心B:Merge it!题意:一个数组,可以选泽把两个数求和后合并为一个数,求最多的能被3...原创 2019-06-10 22:51:34 · 212 阅读 · 0 评论 -
Codeforces Round #560 div3
题目:https://codeforces.com/contest/1165题解:https://codeforces.com/blog/entry/67041A,B:略过C:定义一个字符串是good,如果满足1:长度是偶数2:对每个奇数位置满足s[i] != s[i+1](1-base)问最少删除几个字符可以使原字符串是good分析:贪心,可以看代码...原创 2019-05-16 00:04:14 · 130 阅读 · 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%20div2A.Zoning Restrictions Again题意:给...原创 2019-05-06 12:40:10 · 306 阅读 · 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 · 260 阅读 · 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 · 76 阅读 · 0 评论 -
cf276 div2
A:给了两个数a和m,当天需要再生产a%m个产品,如果s原创 2014-11-06 17:22:47 · 417 阅读 · 0 评论 -
codeforce 39 J
题目链接:http://codeforces.com/problemset/problem/39/J给了liang原创 2014-09-01 15:22:36 · 639 阅读 · 0 评论 -
Codeforces Round #263 (Div. 2)
官方题解:http://codeforces.com/blog/entry/13568题目lia原创 2014-08-28 16:35:45 · 489 阅读 · 0 评论 -
Codeforces Round #263 (Div. 1)
http://codeforces.com/contest/461原创 2014-08-28 16:43:33 · 398 阅读 · 0 评论 -
CodeForce Round 257 div2
A. Jzzhu and Childrentime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n children in Jzzhu's school原创 2014-07-26 05:13:01 · 839 阅读 · 0 评论 -
CF round 259
A. Little Pony and Crystal Minetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwilight Sparkle once got a原创 2014-08-20 16:15:59 · 599 阅读 · 0 评论 -
CodeForce Round 257 div1
官方题解 :http://codeforces.com/blog/entry/13112前三个原创 2014-07-26 05:21:21 · 550 阅读 · 0 评论 -
CodeForce Round 258 div2
官方题解http://codeforces.com/blog/entry/13181原创 2014-07-25 05:28:25 · 837 阅读 · 0 评论