05 2023 档案
摘要:upd: 写你的网络单纯形去 最小费用最大流(原始对偶): ```cpp namespace flow{ // mcmf}{{{ using typ = int; constexpr int V = 1, E = 1; #error V,E unset constexpr int EDGE_NIL
阅读全文
摘要:```cpp ll qmul(ll a, ll b, ll c){ a%=c, b%=c; ll w = (ld)a/c*b; ll r = (ull)a*b-(ull)w*c; return r<0?r+c:r; } ```
阅读全文
摘要:光速最大流: ```cpp namespace flow{ // }{{{ using typ = int; constexpr int V = 1200, E = 120000; int iv, is, it; struct Edge{int to, nxt, lf;} es[E*2+2]; co
阅读全文
摘要:namespace FHQ{ #define siz(x) ({Node *_a_ = x; _a_ == np ? 0 : _a_->sz; }) struct Node{ Node *ls, *rs; char val; int pri; int sz; void updsz(){ sz = 1
阅读全文
摘要:int exgcd(int a, int b, int &x, int &y){ if(!b){ x=1, y=0; return a; } int d = exgcd(b, a%b, x, y); sd swap(x, y); y -= a/b*x; return d; }
阅读全文
摘要:P3426 #include <cstdio> #include <cstring> #include <vector> #define sd std:: namespace m{ // } constexpr int LEN = 1e6; sd vector<int> prepare(char*
阅读全文