摘要: BZOJ1005,给了度就有prufer序,排列组合。 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 struct BigInt { 5 int a[10005], len; 6 7 BigInt() { 8 memset(a, 0, s 阅读全文
posted @ 2019-02-09 01:02 AlphaWA 阅读(131) 评论(0) 推荐(0) 编辑
摘要: BZOJ1001,裸网络流,对偶图做法比较有趣但在这道题上好像有点花哨? 1 #include <bits/stdc++.h> 2 #define ri readint() 3 #define wi(x) writeint(x) 4 #define gc getchar() 5 #define pc 阅读全文
posted @ 2019-02-08 01:28 AlphaWA 阅读(122) 评论(0) 推荐(0) 编辑
摘要: CF618C,水啊。 1 #include <bits/stdc++.h> 2 #define ll long long 3 using namespace std; 4 5 struct point { 6 ll x, y; 7 int id; 8 bool operator < (const p 阅读全文
posted @ 2019-02-06 00:06 AlphaWA 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 石子合并,入门区间dp 1 #include <cstdio> 2 #include <cstring> 3 #define maxn 305 4 #define min(a, b) a < b ? a : b 5 6 int n; 7 int sum[maxn]; 8 int f[maxn][ma 阅读全文
posted @ 2019-02-04 12:47 AlphaWA 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 自然数拆分,完全背包 1 #include <cstdio> 2 #define ll long long 3 #define mod 2147483648 4 #define rep(i, a, b) for (int i = a; i <= b; i++) 5 6 int n; 7 ll f[4 阅读全文
posted @ 2019-02-03 15:14 AlphaWA 阅读(323) 评论(0) 推荐(0) 编辑
摘要: I have a set of super poker cards, consisting of an infinite number of cards. For each positive composite integer p, there are exactly four cards whose 阅读全文
posted @ 2019-02-02 15:08 AlphaWA 阅读(367) 评论(0) 推荐(0) 编辑
摘要: Joyoi Mobile Service,第一维:阶段,第几时刻;第二第三维:不安定因素,两个服务员的位置;省略第四维:肯定在p[i-1]。 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define rep(i, a, b) for (i 阅读全文
posted @ 2019-02-02 11:54 AlphaWA 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Wannafly winter camp的比赛题,大深坑补不完。 Codeforces #371div1的C,dp做法和评论区nlogn做法,看不懂qwq。 BZOJ1006,弦图与最大势算法。 写一篇浅谈burnside引理的blog。参考:BZOJ1004某题解、burnside与polya某简 阅读全文
posted @ 2019-02-01 15:44 AlphaWA 阅读(182) 评论(0) 推荐(0) 编辑
摘要: UVA11992,自己板子真心难调bugwoc 1 #include <bits/stdc++.h> 2 #define maxn 50005 3 using namespace std; 4 5 struct Seg { 6 int l, r; 7 int sum, maxx, minn; 8 } 阅读全文
posted @ 2019-02-01 15:40 AlphaWA 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 洛谷3372,才开始学segment tree,初级板子。 1 #include <cstdio> 2 #define ll long long 3 #define maxn 100001 4 5 int n, m; 6 ll a[maxn], sum[maxn << 2], tag[maxn << 阅读全文
posted @ 2019-01-31 09:49 AlphaWA 阅读(186) 评论(0) 推荐(0) 编辑