ACM
线段树
3188字
ACM
102字
ACM
DP
708字
ACM
3929字
ACM
237字
ACM
构造
1010字
24点小游戏~ 1#include <iostream> 2 3#include <algorithm> 4#include <string> 5#include <vector> 6#include <stack> 7#include <queue> 8#include <set> 9#include <map> 10#include <unordered_map> 11#include <unordered_set> 12#include <random> 13#include <chrono> 14 15#include <cstdio> 16#include <cstring> 17#include <cmath> 18#include <ctime> 19#include <cstdlib> 20#include <cassert> 21 22#define itn int 23#define fro for 24#define scnaf scanf 25#define sacnf scanf 26#define manx maxn 27#define pritnf printf 28 29#define Fastin freopen("in.txt", "r", stdin) 30#define Fastout freopen("out.txt", "w", stdout) 31#define min(a, b) ((a) < (b)? (a): (b)) 32#define max(a, b) ((a) > (b)? (a): (b)) 33#define lowbit(x) ((x) & (-x)) 34#define ceil(n, p) (((n) +(p) - 1) / (p)) 35#define DBG(x) (void)(cout << "L" << __LINE__ << ": " << #x << " = " <<( x) << '\n') 36#define clr(a, x) memset((a), x, sizeof (a)) 37#define TTT int __; scanf("%d", &__); while(__--) 38using
...
ACM
set
585字
ACM
树
构造
1088字
ACM
1541字
1006 1const itn maxn = 1e5 + 10; 2 3int n, m, w[maxn]; 4struct star{int to, next;}; 5 6int head[maxn], top = 0; 7int du[maxn], K; 8star edge[maxn << 1]; 9void add(int u, int v){ 10 edge[top].to = v; 11 edge[top].next = head[u]; 12 head[u] = top++; 13} 14 15unordered_map<int, int> mp[maxn]; 16unordered_map<int, int> conv; 17 18int c[700][maxn], bitcnt = 0, zero[maxn]; 19void add(int id, int i, int x, int n){ 20 while(i <= n){ c[id][i] += x; i += lowbit(i);} 21} 22int query(int id, int i){ 23 int ans = 0; 24 while(i){ans += c[id][i]; i -= lowbit(i);} return ans; 25} 26 27void bitupdate(int u, int key, int op){ 28 assert(conv.count(u) == 1); 29 int id = conv[u]; add(id, key, op, du[u]); 30} 31 32//将u节点的邻接权值ke
...
ACM
网络流
657字
两个定理的证明 https://www.cnblogs.com/cniwoq/p/9245813.html spfa的一些说明 https://blog.csdn.net/xiazdong/article/details/8193680 dinic 1const itn maxn = 1200 + 10; 2const int maxe = 120000 + 10; 3const ll inf = 1ll << 60; 4 5struct star{int to, next, w;}; 6int head[maxn], top = 0; 7star edge[maxe << 1]; 8 9void add(int u, int v, int w){ 10 edge[top].to = v; 11 edge[top].next = head[u]; 12 edge[top].w = w; 13 head[u] = top++; 14} 15 16int d[maxn], cur[maxn]; 17 18ll dfs(int s, int t, ll flow){ 19 if(flow == 0 || s == t) return flow; 20 21 ll res = 0, f; 22 for(int i = cur[s]; ~i; i = edge[i].next){ 23 cur[s] = i; 24 if(d[edge[i].to] == d[s] + 1){ 25 f = dfs(edge[i].to, t, min(flow, (ll)edge[i].w)); 26 edge[i].w -= f; edge[i
...
ACM
157字
ACM
计算几何
2108字
ACM
树上二分
1851字
ACM
模拟
525字
技术
对拍
139字