03 2017 档案

多校4
摘要:5道 K HDU 5774 直接贴过来模拟 出现的次数 #include<stdio.h> #include<algorithm> #include<stdlib.h> #include<cstring> #include<string> #include<cmath> #include<vecto 阅读全文

posted @ 2017-03-30 21:40 HelloWorld!--By-MJY 阅读(204) 评论(0) 推荐(0)

多校2
摘要:A HDU 5734 t 组样例 n n个数字 w[i] b 是1或者 -1 求 min 1~n sum(w[i]-a*b)^2 展开 1~n sum(w[i]^2) + a*a*n- 2*a*(w[1]*b1+w[2]*b2 ...); a>0 二次函数 a变量 最小 a= (w[1]*b1... 阅读全文

posted @ 2017-03-26 17:01 HelloWorld!--By-MJY 阅读(154) 评论(0) 推荐(0)

2016多校1
摘要:HDU 5723 A t 组样例 n个点m条边 然后m条无向边 a b w 求他的最小生成树的 花费 然后求 每2个点的花费的期望 先跑一个最小生成树 然后呢 要求期望 先要求出一个 总体花费 然后 /(n*(n-1)/2) 那么怎么求花费呢 比如说样例 1 - 2 - 3 - 4 1 2 3 用d 阅读全文

posted @ 2017-03-24 20:02 HelloWorld!--By-MJY 阅读(220) 评论(0) 推荐(0)

百度之星 初赛B续
摘要:HDU 5698 C 先找规律 0 0 0 0 0 0 0 1 1 1 1 1 0 1 2 3 4 5 0 1 3 6 10 15 0 1 4 10 20 35 我操 这不是杨辉三角吗 gg 然后找规律 要求的 不就是 C(n+m-4,m-2); 然后呢 要 a/b mod(1e9+7) = a * 阅读全文

posted @ 2017-03-22 21:06 HelloWorld!--By-MJY 阅读(180) 评论(0) 推荐(0)

百度之星 初赛B
摘要:HDU 5696 暴力 莫名的东西 #include<stdio.h> #include<algorithm> #include<stdlib.h> #include<cstring> #include<string> #include<cmath> #include<vector> #includ 阅读全文

posted @ 2017-03-21 21:33 HelloWorld!--By-MJY 阅读(264) 评论(0) 推荐(0)

百度之星初赛 A
摘要:HDU 5693 在当前剩下的有序数组中选择X(X≥2)X(X≥2) 个连续数字; 1 看题目要注意后面几个字 要不就是删2 个要不就是删3个 3个以上可以由 2 3 组成 GGG 然后就是区间DP dp[i][j] 代表 从i 到 j 最多可以删除几个 然后呢 dp[i][j] = max ( d 阅读全文

posted @ 2017-03-21 19:39 HelloWorld!--By-MJY 阅读(156) 评论(0) 推荐(0)

百度之星 初赛 BC
摘要:HDU 5691 这B题目 一看就知道不会 看题解 听说是状态 压缩 立刻就不想写了 今天状态好点 写一下 dp[i][j] 代表 i 这个状态 第j个当做结尾插入的 最大的加起来的和 初始化也很神奇 先初始化没每个状态的1的个数 然后转移 列举前一个 这个 #include<stdio.h> #i 阅读全文

posted @ 2017-03-20 21:51 HelloWorld!--By-MJY 阅读(265) 评论(0) 推荐(0)

2016 百度之星资格赛
摘要:A 前缀的积可以求出来 然后 z[b]/z[a-1] 就是要求的 求一下 z[a-1]的逆元 m为素数 可以用费马小定理 B 斐波那契数列 果断Java import java.math.*; import java.util.*; import java.lang.*; public class 阅读全文

posted @ 2017-03-19 15:55 HelloWorld!--By-MJY 阅读(323) 评论(0) 推荐(0)

codeforces 749
摘要:A 给你一个N 让你拆分成 个数最多 和素数的和 偶数 2 ... 奇数 2... 3 #include<stdio.h> #include<algorithm> #include<cstring> #include<string> #include<cmath> #include<vector> 阅读全文

posted @ 2017-03-18 20:51 HelloWorld!--By-MJY 阅读(152) 评论(0) 推荐(0)

codeforces 785
摘要:A 直接模拟 开2个数组存一下 这样块 #include<stdio.h> #include<algorithm> #include<cstring> #include<string> #include<cmath> #include<vector> #include<queue> using na 阅读全文

posted @ 2017-03-17 21:12 HelloWorld!--By-MJY 阅读(149) 评论(0) 推荐(0)

HDU 4617
摘要:复习了一下大一的东西 都忘记了 题意是 n 个无限长的圆柱 给你 n 然后 圆心 圆上2点 n个 求 能不能相交 相交 lucky 否则 输出最短距离 先求 2 平面 法向量 求出 这2个法向量 的法向量 n 然后取直线上2点 ab d = fabs(n*ab)/|n|; 难受 #include<s 阅读全文

posted @ 2017-03-15 21:16 HelloWorld!--By-MJY 阅读(140) 评论(0) 推荐(0)

网络流 poj 2195
摘要:最小费用最大流的模板题 超级源点 m H 超级汇点 容量 1 1 1 费用 0 距离 0 #include<stdio.h> #include<algorithm> #include<cstring> #include<string> #include<cmath> #include<vector> 阅读全文

posted @ 2017-03-15 19:07 HelloWorld!--By-MJY 阅读(128) 评论(0) 推荐(0)

网络流 poj 3436 poj 3281
摘要:poj 3436 一个电脑有p个部分 n 台机器 n 个机器 每个机器 最多能服务的电脑数目 电脑进来时候需要的 0 代表一定不要 1 一定要 2可有可无 然后就是出去的电脑 0 代表没的 1代表有 超级源点 p 部分没有1 出来的满足进去的条件 都是1 汇点 0 权 两点连 权值是小的 权 n+1 阅读全文

posted @ 2017-03-13 21:15 HelloWorld!--By-MJY 阅读(190) 评论(0) 推荐(0)

codeforces 780 C
摘要:n 个点 n-1条边 相连的三个点颜色不能相同比赛的时候没出 阅读全文

posted @ 2017-03-12 10:51 HelloWorld!--By-MJY 阅读(285) 评论(0) 推荐(0)

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 阅读(215) 评论(0) 推荐(0)

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 阅读(136) 评论(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 阅读(141) 评论(0) 推荐(0)

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 阅读(218) 评论(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 阅读(184) 评论(0) 推荐(0)

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

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

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 阅读(120) 评论(0) 推荐(0)

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

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

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 阅读(126) 评论(0) 推荐(0)

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

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

二分三分
摘要:HDU 2274 三分 求这些二次函数最大值最小 反正三分能求吧 #include <iostream> #include<string.h> #include<stdio.h> #include<algorithm> #include<string> #include<math.h> using 阅读全文

posted @ 2017-03-02 20:00 HelloWorld!--By-MJY 阅读(180) 评论(0) 推荐(0)

二分
摘要:1 codeforces 371 汉堡的组成 已经有的数目 小店里买的价格 自己有的钱 二分汉堡的个数 #include <iostream> #include<string.h> #include<stdio.h> #include<algorithm> #include<string> usin 阅读全文

posted @ 2017-03-02 18:04 HelloWorld!--By-MJY 阅读(154) 评论(0) 推荐(0)

codeforces 779
摘要:A 2 个集合分别有 n个数字 交换a b中的 数字 使得2个集合中数字数目一样 直接模拟 #include <iostream> #include<string.h> #include<stdio.h> #include<algorithm> #include<string> using name 阅读全文

posted @ 2017-03-01 15:32 HelloWorld!--By-MJY 阅读(236) 评论(0) 推荐(0)

导航