摘要: "题目链接" 记$dp(i)$为以第i个结尾的上升子序列的个数,可以得到转移方程 $$dp(i)=\sum_{j=1,\,a[j] include include include include include include include include include include incl 阅读全文
posted @ 2017-08-20 20:47 可达龙 阅读(144) 评论(0) 推荐(0) 编辑
摘要: "题目链接" 模板题 按顺序BFS一边就可以判断结果了 C++ include include include include include include include include include include include include include using namespac 阅读全文
posted @ 2017-08-20 20:35 可达龙 阅读(215) 评论(0) 推荐(0) 编辑
摘要: "题目链接" 模板题 区间更新单点查询的树状数组 实现区间[i,j]增加val。 查询方式即前n项和 C++ include include include include include include include include include include include include 阅读全文
posted @ 2017-08-20 17:05 可达龙 阅读(200) 评论(0) 推荐(0) 编辑
摘要: "题目链接" 超级麻烦的一题,开始还理解错题目意思了。。。!看着udebug的数据才明白,重读一遍题目。。。 三个机器人移动一致,碰到障碍物的机器人就无法向障碍物方向移动,机器人自己也算障碍物。麻烦在机器人当作障碍物的地方。 标记状态BFS暴力 C++ include include include 阅读全文
posted @ 2017-08-20 16:36 可达龙 阅读(134) 评论(0) 推荐(0) 编辑
摘要: " Codeforces Round 429 C 题目链接 " 这题规律很好找,用最大的跟最小的匹配就好了,但是证明还是挺烦人的。听说是高考题。。。 $F(n,r) = 1p_1+2p_2+3p_3+\cdots+kp_k$, 其中k是选取的最小值,$p_k$表示的是选取最小值的概率。 $$F(n, 阅读全文
posted @ 2017-08-20 11:25 可达龙 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 众所周知,bellman_ford算法最常用的性质是判负环 也可以求最短路,SPFA算法改自Bellman_Ford。 1074 Extended Traffic $(u,v)$的边权是$ (b[v] b[u])^3$,输出从顶点1到各点最短路径,因为存在负环,所以从负环到达的点的最短路是 inf。 阅读全文
posted @ 2017-08-20 00:49 可达龙 阅读(284) 评论(0) 推荐(0) 编辑
摘要: "题目链接" 暴力枚举结果情况,然后跟当前比较,找到最小次数 C++ include include include using namespace std; int t; char s[1005]; int main() { scanf("%d", &t); while(t ) { scanf(" 阅读全文
posted @ 2017-08-20 00:11 可达龙 阅读(254) 评论(0) 推荐(0) 编辑