/* qq:1239198605 ctgu_yyf */#include<iostream>#include<cstdio>#include<string>#include<vector>#include<queue>#include<stack>#include<algorithm>#includ ...
分类:
其他好文 时间:
2018-05-12 22:28:23
阅读次数:
178
题目链接: https://cn.vjudge.net/problem/POJ-2886 题目大意: N个人围成一圈第一个人跳出圈后会告诉你下一个谁跳出来跳出来的人(如果他手上拿的数为正数,从他左边数A个,反之,从他右边数A个) 跳出来的人所得到的糖果数量和他跳出的顺序有关 所得的糖果数为 (假设他 ...
分类:
其他好文 时间:
2018-05-12 02:46:04
阅读次数:
200
真·水题。 环形均分纸牌模板题。 只需求出前缀和,然后取中位数求二重前缀和即可。 1 #include <cstdio> 2 #include <algorithm> 3 using namespace std; 4 typedef long long LL; 5 const int N = 100 ...
分类:
其他好文 时间:
2018-05-11 14:38:25
阅读次数:
162
XiaoMing likes mathematics, and heis just learning how to convert numbers between different bases , but he keeps making errorssince he is only 6 years ...
分类:
其他好文 时间:
2018-05-10 19:59:55
阅读次数:
206
XiaoMing likes mathematics, and heis just learning how to convert numbers between different bases , but he keeps making errorssince he is only 6 years ...
分类:
其他好文 时间:
2018-05-06 14:53:41
阅读次数:
194
题目链接: http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=36 最长公共子序列 时间限制:3000 ms | 内存限制:65535 KB 难度:3 最长公共子序列 时间限制:3000 ms | 内存限制:65535 KB 难度:3 ...
分类:
其他好文 时间:
2018-05-06 12:17:04
阅读次数:
175
题目链接: http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=44 子串和 时间限制:5000 ms | 内存限制:65535 KB 难度:3 子串和 时间限制:5000 ms | 内存限制:65535 KB 难度:3 ...
分类:
其他好文 时间:
2018-05-06 12:15:34
阅读次数:
188
题意: 有4堆糖,每堆有n个,每次从某一堆的堆顶拿一个放进篮子里,如果篮子里有2个颜色相同的糖果,那么就可以放进袋子里。 当篮子里有5个糖果并且没有相同颜色的糖果时,这个时候就不能再拿了。 问最多可以拿多少对颜色相同的糖果。 思路: 记忆化搜索。 设dp[x][y][z][w]表示第一堆拿走了x个, ...
分类:
其他好文 时间:
2018-05-06 00:23:58
阅读次数:
196
题目链接: http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=171 分析: kk每次只能向右边和下边走,所以取他的上面和左边的最大值加上自己 dp[i][j]=f_max(dp[i-1][j],dp[i][j-1])+a[i][j]; 代码如下 ...
分类:
其他好文 时间:
2018-05-05 17:18:30
阅读次数:
178
对这个奇形怪状的图tarjan,然后重新连边把图变成DAG,然后记忆化搜索即可 cpp include include using namespace std; const int N=100005; int n,a[N],h[N],cnt,dfn[N],low[N],tot,s[N],top,bl ...
分类:
其他好文 时间:
2018-05-05 15:31:32
阅读次数:
157