会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
lxtx
博客园
首页
新随笔
联系
订阅
管理
2017年6月17日
【专题】单调栈
摘要: poj2559 弄个单调递增栈扫一遍,然后每次出栈更新一下答案,再记录一下最小的坐标传给进栈元素就好啦。别忘了开LL... (好像这题还能dp 1 #include<cstdio> 2 #define N 100010 3 #define repu(i,x,y) for(i=x;i<=y;i++)
阅读全文
posted @ 2017-06-17 09:40 lxtx
阅读(242)
评论(0)
推荐(0)
2017年6月15日
【模版】树的直径
摘要: 树的直径,即这棵树中距离最远的两个结点的距离。 方法一:用两次bfs,求出1的最远点x,再求x的最远点y,xy即为直径 1 #include<cstdio> 2 #define N 10001 3 #define repu(i,x,y) for(i=x;i<=y;i++) 4 struct edge
阅读全文
posted @ 2017-06-15 13:23 lxtx
阅读(149)
评论(0)
推荐(0)
2017年6月14日
【poj2186】Popular Cows
摘要: 传送门 tarjan缩点后是个DAG,然后只有一个出度为0的点的话就输出该点的大小,否则为0。 1 #include<cstdio> 2 #define repu(i,x,y) for(i=x;i<=y;i++) 3 #define min(a,b) (a<b?a:b) 4 #define N 50
阅读全文
posted @ 2017-06-14 17:25 lxtx
阅读(93)
评论(0)
推荐(0)
【luogu1455】搭配购买
摘要: 传送门 每个联通块看成一个整体,然后做个背包就好啦。 1 #include<cstdio> 2 #define N 10001 3 #define repu(i,x,y) for(i=x;i<=y;i++) 4 #define max(a,b) (a>b?a:b) 5 struct edge{ 6
阅读全文
posted @ 2017-06-14 17:23 lxtx
阅读(114)
评论(0)
推荐(0)
2017年6月7日
【模版】tarjan算法
摘要: 强连通分量 推荐:https://www.byvoid.com/zht/blog/scc-tarjan/ 1 #include<cstdio> 2 #include<cstring> 3 #define repu(i,x,y) for(i=x;i<=y;i++) 4 #define N 2001 5
阅读全文
posted @ 2017-06-07 21:35 lxtx
阅读(148)
评论(0)
推荐(0)
2017年6月2日
【USACO2.1.1】The Castle城堡
摘要: 传送门 还以为要打很长呢。 1 #include<cstdio> 2 #define N 51 3 #define repu(i,x,y) for(i=x;i<=y;i++) 4 #define max(a,b) (a>b?a:b) 5 int n,m,a[N][N],f[N][N],x=0,s[N
阅读全文
posted @ 2017-06-02 14:15 lxtx
阅读(202)
评论(0)
推荐(0)
【USACO2.2.4】Party Lamps派对灯
摘要: 传送门 最近在写usaco的题。。 这个考虑到同种操作是可以抵消的,然后就从初状态开始枚举就好了。 1 #include<cstdio> 2 #include<algorithm> 3 #define repu(i,x,y) for(i=x;i<=y;i++) 4 #define min(a,b)
阅读全文
posted @ 2017-06-02 13:26 lxtx
阅读(148)
评论(0)
推荐(0)
2017年5月30日
Hello world!
摘要: Hello world!
阅读全文
posted @ 2017-05-30 22:29 lxtx
阅读(79)
评论(0)
推荐(0)
公告