会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
pubgoso
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
5
6
下一页
2019年3月9日
牛客 被3整除的子序列dp
摘要: 题意很清楚,直接dp即可,dp[i][j]表示到第i个字符的状态为j的方案数,这里状态指的是子序列最大下标到第i直接dp即可,dp[i][j]表示到第i个字符的状态为j的方案数,这里状态指的是子序列最大下标到第i直接dp即可,dp[i][j]表示到第i个字符...
阅读全文
posted @ 2019-03-09 12:55 pubgoso
阅读(194)
评论(0)
推荐(0)
2019年3月8日
导弹拦截 dp
摘要: n∗lognn*lognn∗logn写法,lis[i]的意义为:所有最长上升子序列长度为i的位置上的最小a数组元素值lis[i]的意义为:所有最长上升子序列长度为i的位置上的最小a数组元素值lis[i]的意义为:所有最长上升子序列长度为i的位置上的最小a数组...
阅读全文
posted @ 2019-03-08 21:06 pubgoso
阅读(202)
评论(0)
推荐(0)
2019年3月7日
蓝桥杯 大臣的旅费
摘要: 看完题,大概就懂是求树的直径了,然后求树的直径,就自己选方法了。。。。。。(从网上抄的)#include#define LL long long#define fi first#define se second#define mp make_pair#def...
阅读全文
posted @ 2019-03-07 21:25 pubgoso
阅读(241)
评论(0)
推荐(0)
蓝桥杯-城市建设
摘要: 读完题就知道是生成树的题,然后注意一下就是,找完一颗树之后,遍历剩下的边,小于0就在加上即可。先找没河的,再加上有河的再跑一遍克鲁斯卡尔就好了。#include#define LL long long#define fi first#define se se...
阅读全文
posted @ 2019-03-07 14:07 pubgoso
阅读(186)
评论(0)
推荐(0)
2019年3月3日
Educational Codeforces Round 47 (Rated for Div. 2)E.Intercity Travelling
摘要: 题目链接大意:一段旅途长度N,中间可能存在N-1个休息站,连续走k长度时,疲劳值为a1+a2+...+aka_1+a_2+...+a_ka1+a2+...+ak,休息后a1a_1a1开始计,设PPP为疲劳值的期望,问p∗2n−1取模998244353...
阅读全文
posted @ 2019-03-03 11:35 pubgoso
阅读(107)
评论(0)
推荐(0)
2019年3月1日
球相交模板
摘要: #define PI acos(-1.0)#define ll long long intconst int maxn = 1e2 + 5;using namespace std;struct point { // 这里的点是指球 double x,y...
阅读全文
posted @ 2019-03-01 21:50 pubgoso
阅读(137)
评论(0)
推荐(0)
Codeforces Round #494 (Div. 3) D. Coins and Queries(贪心
摘要: 题目链接题目大意:给你n个物品,第iii个物品价值aia_iai,询问q次,问你能不能凑出价值为qiq_iqi的物品。小贪心吧。从大到小找,能拿就拿就行了。 #include#define LL long long#define fi first#def...
阅读全文
posted @ 2019-03-01 15:40 pubgoso
阅读(276)
评论(0)
推荐(0)
2019年2月21日
CF 1060E. Sergey and Subway
摘要: 题目链接题意:给你一棵树,然后连接两个有公共邻居的点,问你连完后,任意两点的距离之和。一开始看这种题,还不怎么会做,借鉴了这位大佬的博客,get到了新技能,当我们求树上任意俩点的距离之时,可以转化问题,不看点,而看边,每条边的使用次数是固定的,每条边使用的次...
阅读全文
posted @ 2019-02-21 16:03 pubgoso
阅读(115)
评论(0)
推荐(0)
2019年2月20日
Codeforces Round #540 (Div. 3)
摘要: A链接讨论一下2a2a2a跟bbb的大小关系即可。#include #include #include #include #include #include #include #include #include #include #include #incl...
阅读全文
posted @ 2019-02-20 13:41 pubgoso
阅读(233)
评论(0)
推荐(0)
2019年1月29日
牛客寒假算法基础集训营4 G(最小生成树)
摘要: 题目链接题目要求的是得到k种不同的元素,(题解)将每种类型视为一个点,跑一边克鲁斯卡尔即可。#include #include #include #include #include #include #include #include #include #i...
阅读全文
posted @ 2019-01-29 20:18 pubgoso
阅读(137)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
下一页
公告