上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 22 下一页

2017年3月12日

codeforces 780B

摘要: n 个点 开始的位置 速度可以左边 也可以右边 三分距离算时间 换个写法 #include<stdio.h> #include<algorithm> #include<cstring> #include<string> #include<cmath> using namespace std; #de 阅读全文

posted @ 2017-03-12 10:31 HelloWorld!--By-MJY 阅读(200) 评论(0) 推荐(0) 编辑

2017年3月11日

codeforces 61 D 115 A

摘要: D 从1开始走 走过所有的点 最少的花费 显然 走到叶子节点 最大的费用 不用算 那么就是从根开始走走到叶子的距离处理出来 dis[i] 从根到i 的距离 #include<stdio.h> #include<string.h> #include<algorithm> using namespace 阅读全文

posted @ 2017-03-11 15:08 HelloWorld!--By-MJY 阅读(131) 评论(0) 推荐(0) 编辑

codeforces 25D

摘要: n 个点 n-1条边 不一定是树 要把它变成一棵树 最少要删除几条边 每删除一条边可以在另外地方造一条边 并查集 #include<stdio.h> #include<algorithm> #include<cstring> #include<string> #include<cmath> #inc 阅读全文

posted @ 2017-03-11 08:57 HelloWorld!--By-MJY 阅读(131) 评论(0) 推荐(0) 编辑

2017年3月9日

codeforces 14D

摘要: 去掉一条边 剩下的2棵树的直径 乘积 求最大 列举每条边 2次bfs求直径 其实总共是 4*(n-1) 次bfs 总体时间 n-1*n; #include<stdio.h> #include<algorithm> #include<cstring> #include<string> #include 阅读全文

posted @ 2017-03-09 21:32 HelloWorld!--By-MJY 阅读(201) 评论(0) 推荐(0) 编辑

codeforces 6E

摘要: n 个数字 取一段区间 求最大最小的差 <=k 问最大的长度 这样长度的区间有几个 问长度最长的区间的l r 1 题目看不懂 2 看题解 线段树+二分 其实我也没碰到过这种的 线段树维护 l r 最大值和最小值 然后二分 i 到 l r 这一段区间能到的最右边的值 维护一下 #include<std 阅读全文

posted @ 2017-03-09 20:13 HelloWorld!--By-MJY 阅读(179) 评论(0) 推荐(0) 编辑

2017年3月8日

CF 750

摘要: 今天CF打的块残废了 就是一废物 A 在24点之前到 直接模拟即可 B 显然东西是没用的 但是在南北极就出问题了 从北极点开始 最后要回到北极点 在北极点 只能往南边 南极同理 不然就有问题 然后 40000 不能随便%掉 因为可能走到一边点 然后还是这个方向 就翻车了 就分类讨论 唉 翻车翻车 # 阅读全文

posted @ 2017-03-08 21:24 HelloWorld!--By-MJY 阅读(166) 评论(0) 推荐(0) 编辑

2017年3月7日

poj 2976 0 1 分数规划

摘要: 一脸懵逼 好像是个很高端的东西 0 1 分数规划 其实就是二分一下 不会证明 #include<stdio.h> #include<algorithm> #include<cstring> #include<string> #include<cmath> using namespace std; # 阅读全文

posted @ 2017-03-07 20:27 HelloWorld!--By-MJY 阅读(113) 评论(0) 推荐(0) 编辑

HYSBZ - 2038

摘要: 传说中的莫队算法 时间 n*sqrt(n); 没的修改 然后从前往后跑 重复的就节约下来了 阅读全文

posted @ 2017-03-07 19:22 HelloWorld!--By-MJY 阅读(182) 评论(0) 推荐(0) 编辑

2017年3月6日

uva 11582

摘要: 斐波那契数论 求第 a^b 项 %c 听说有循环结 #include<stdio.h> #include<algorithm> #include<cstring> #include<string> #include<cmath> using namespace std; #define MAXN 6 阅读全文

posted @ 2017-03-06 08:55 HelloWorld!--By-MJY 阅读(118) 评论(0) 推荐(0) 编辑

2017年3月4日

poj 2104

摘要: 区间第K小 刚刚学的划分树 感觉树的作用就是 n^2 -> n logn 分治一下 划分成左右2个子树 然后小的左边 大的右边 阅读全文

posted @ 2017-03-04 11:08 HelloWorld!--By-MJY 阅读(125) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 22 下一页

导航