会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
wangyucheng
我是傻x......
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
5
6
7
下一页
2014年4月16日
bzoj 2001 [Hnoi2010]City 城市建设 cdq分治
摘要: #include#include#include#includeusing namespace std;typedef long long ll;#define N 50010#define inf 0x6fffffffffLLstruct P{ int x,y; ll w,org; ...
阅读全文
posted @ 2014-04-16 08:33 wangyucheng
阅读(1307)
评论(0)
推荐(0)
2014年4月14日
poj1739 Tony's Tour 插头dp求哈密顿回路
摘要: #include#include#include#includeusing namespace std;#define N 10#define M (1>((k-1)*2))&3); } cout>m*2){ cont...
阅读全文
posted @ 2014-04-14 19:09 wangyucheng
阅读(187)
评论(0)
推荐(0)
bzoj 3168: [Heoi2013]钙铁锌硒维生素 线性代数+二分图匹配
摘要: #include#include#include#include#define mod 999983#define maxn 302#define F(x,y) for(int x=1;x>n; F(i,n)F(j,n)scanf("%lld",&a[i][j]); F(i,n)F(j,...
阅读全文
posted @ 2014-04-14 11:53 wangyucheng
阅读(309)
评论(0)
推荐(0)
2014年4月11日
bzoj 1036: [ZJOI2008]树的统计Count动态树
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define maxn 60500 8 #define inf 0x3fffffff 9 int ch[maxn][2]; 10 int s[maxn],ma[maxn],val[maxn],pre[maxn],rt[maxn]; 11 int n,nn; 12 int e[maxn],ne[maxn*2],f[maxn],v[maxn*2]; 13 void add(int x,int y){ 14 ne...
阅读全文
posted @ 2014-04-11 19:07 wangyucheng
阅读(163)
评论(0)
推荐(0)
BZOJ-2561: 最小生成树(最小割)
摘要: 题目:http://www.lydsy.com/JudgeOnline/problem.php?id=2561#include#include#include#include#includeusing namespace std;#define maxn 20010#define maxm 400100int e[maxn],u[maxm],ne[maxm],v[maxm],l[maxm],n,m,tt=1;int s,t,L;bool been[maxn];void add(int x,int y,int z){ ne[++tt]=e[x],e[x]=tt,v[tt]=y,l[...
阅读全文
posted @ 2014-04-11 16:46 wangyucheng
阅读(224)
评论(0)
推荐(0)
2014年4月9日
bzoj1797 [AHOI2009]Mincut-最小割的关键割边
摘要: 求最大流,在残余网络上跑tarjan求出所有SCC,记id[u]为点u所在SCC的编号。显然有id[s]!=id[t](否则s到t有通路,能继续增广)。①对于任意一条满流边(u,v),(u,v)能够出现在某个最小割集中,当且仅当id[u]!=id[v];②对于任意一条满流边(u,v),(u,v)必定出现在最小割集中,当且仅当id[u]==id[s]且id[v]==id[t]。#include#include#include#include#includeusing namespace std;#define maxn 4200#define maxm 130000#define inf 0x3
阅读全文
posted @ 2014-04-09 17:54 wangyucheng
阅读(503)
评论(0)
推荐(0)
2014年4月2日
bzoj 1449: [JSOI2009]球队收益 凸费用拆边费用流 由于有负边,先spfa处理顶标然后zkw
摘要: /************************************************************** Problem: 1449 User: wangyucheng Language: C++ Result: Accepted Time:268 ms Memory:2532 kb****************************************************************/ #include#include#include#include#includeusing namespace std;#de...
阅读全文
posted @ 2014-04-02 21:21 wangyucheng
阅读(303)
评论(0)
推荐(0)
bzoj 2300: [HAOI2011]防线修建 平衡树维护凸包
摘要: /************************************************************** Problem: 2300 User: wangyucheng Language: C++ Result: Accepted Time:564 ms Memory:7292 kb****************************************************************/ #include#include#include#include#include#includeusing namespace...
阅读全文
posted @ 2014-04-02 19:34 wangyucheng
阅读(381)
评论(0)
推荐(0)
2014年4月1日
bzoj 2038: [2009国家集训队]小Z的袜子(hose) 莫队算法
摘要: #include#include#include#include#includeusing namespace std;#define maxn 60000typedef long long ll;ll gcd(ll x,ll y){ if(x>y)return gcd(y,x); return x==0?y:gcd(y%x,x);}ll S;struct P{ ll l,r,c; bool operatoraa[i-1].r)for(int j=aa[i-1].r+1;jaa[i-1].l)for(int j=aa[i-1].l;j<aa[i].l;j++)dele(j); i.
阅读全文
posted @ 2014-04-01 21:42 wangyucheng
阅读(155)
评论(0)
推荐(0)
bzoj 1202: [HNOI2005]狡猾的商人 并查集
摘要: 在并查集的同时维护到第一个点的距离#include#include#include#include#includeusing namespace std;#define maxn 200int f[maxn];int t[maxn];int get(int x){ if(f[x]==x)return x; int l=get(f[x]); t[x]+=t[f[x]]; return f[x]=l;}int n,m;int w;int main(){ scanf("%d",&w); while(w--){ bool p=0; scanf("%d%d"
阅读全文
posted @ 2014-04-01 20:18 wangyucheng
阅读(131)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
下一页
公告