摘要: 1 #include 2 #define ll long long 3 using namespace std; 4 const int N=10010,maxn=10000; 5 int n,a[N],u[N],p[N],totp; 6 ll f[N]; 7 bool isp[N]; 8 inline ll calc(ll k){return k*(k-1)*(k-2)*(k-... 阅读全文
posted @ 2018-03-08 13:19 Cupcake 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #define myp pair 3 #define mp make_pair 4 using namespace std; 5 const int N=30,N2=900,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1},oo=2e9; 6 int n,m,d,tot,super_s,super_t,h[N][N],sum; 7 inl... 阅读全文
posted @ 2018-03-08 13:18 Cupcake 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 建图很巧妙。 1 #include 2 #define ll long long 3 using namespace std; 4 const int N=4010; 5 const ll oo=3e18; 6 int tot,n,m,f,s,p,super_s,super_t; 7 struct Edge{ 8 int from,to; 9 ll flow,ca... 阅读全文
posted @ 2018-03-08 13:17 Cupcake 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int N=160,M=6010; 4 int n,m,link[Npoint[N<<1]; 6 bool used[N<<1],start[N]; 7 bool find(int k){ 8 for(int i=0;i<point[k].size();i++)if(!used[point[... 阅读全文
posted @ 2018-03-08 13:16 Cupcake 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int N=1050,K=30,oo=1e9; 4 int k,n,ss,tt,cnt[K]; 5 struct Edge{ 6 int from,to,flow,cap; 7 Edge(int _from=0,int _to=0,int _flow=0,int _cap=0):fr... 阅读全文
posted @ 2018-03-08 13:15 Cupcake 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int N=510,M=251000,oo=2e9; 4 int n,a[N],f[N],ss,tt; 5 struct Edge{ 6 int from,to,flow,cap; 7 Edge(int _from=0,int _to=0,int _flow=0,int _cap=0... 阅读全文
posted @ 2018-03-08 13:15 Cupcake 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 注意manacher的写法 注释掉的是TLE的代码 1 #include 2 #define ll long long 3 #define db double 4 using namespace std; 5 const int N=150010; 6 const ll mod=1e9+7; 7 const db PI=acos(-1); 8 struct Complex{ 9 ... 阅读全文
posted @ 2018-03-08 13:14 Cupcake 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int N=60,M=4010,oo=2e9; 4 int n,ss=4000,tt=4001,f[M]; 5 bool vis[M]; 6 struct Edge{ 7 int from,to,flow,cap; 8 Edge(int _from=0,int _to=0,int ... 阅读全文
posted @ 2018-03-08 13:12 Cupcake 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 把式子化简后发现是几个卷积形式 阅读全文
posted @ 2018-03-08 13:10 Cupcake 阅读(98) 评论(0) 推荐(0) 编辑