上一页 1 ··· 5 6 7 8 9 10 下一页
摘要: 光速最大流: ```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 阅读全文
posted @ 2023-05-23 10:42 383494 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2023-05-14 14:02 383494 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 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; } 阅读全文
posted @ 2023-05-07 20:29 383494 阅读(5) 评论(0) 推荐(0) 编辑
摘要: P3426 #include <cstdio> #include <cstring> #include <vector> #define sd std:: namespace m{ // } constexpr int LEN = 1e6; sd vector<int> prepare(char* 阅读全文
posted @ 2023-05-02 14:33 383494 阅读(13) 评论(0) 推荐(0) 编辑
摘要: luogu P2123 题目描述 皇后有 $n$ 位大臣,每位大臣的左右手上面分别写上了一个正整数。恰逢国庆节来临,皇后决定为 $n$ 位大臣颁发奖金,其中第 $i$ 位大臣所获得的奖金数目为第 $i-1$ 位大臣所获得奖金数目与前 $i$ 位大臣左手上的数的和的较大值再加上第 $i$ 位大臣右手上 阅读全文
posted @ 2023-04-29 20:42 383494 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 自己口胡版:就是在 \(\mathbf{Z}_p[\sqrt g]\) 上做 NTT,\(g\) 为 \(p\) 的二次非剩余。 原版:就是在 \(\mathbf{Z}_p[\sqrt{-1}]\) 上做 NTT。要求 \(-1\) 为 \(p\) 的二次非剩余。 感兴趣的可以看看提交记录 两者均被 阅读全文
posted @ 2023-04-02 10:48 383494 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 换纯wayland,在.bashrc中加入`export MOZ_ENABLE_WAYLAND=1` 附检测方法:Firefox 地址栏输入`about:support`,找关键字 `Window Protocol`。 阅读全文
posted @ 2023-01-28 16:15 383494 阅读(102) 评论(0) 推荐(0) 编辑
摘要: $f(x)=x^2+c$ 满足:$\forall x \equiv y\pmod n$,$f(x)\equiv f(y) \pmod n$. 用 $f(x)$ 生成一列数 $a_0 = x, a_n = f^{(n)}(x)=f(a_{n-1})$. 这意味着对要分解的数 $m$ 的一个因子 $p$ 阅读全文
posted @ 2023-01-27 16:49 383494 阅读(8) 评论(0) 推荐(0) 编辑
摘要: constexpr int N = 10001; struct Heap{ int datA[N]; // start from 1 int siz; // int (*topper)(int, int); #define topper(a, b) ((a)<(b)) void up(int id) 阅读全文
posted @ 2023-01-27 14:00 383494 阅读(9) 评论(0) 推荐(0) 编辑
摘要: #include <algorithm> using std::min; using std::max; typedef unsigned long long ull; typedef long long ll; constexpr ull BASE = 100000000; constexpr u 阅读全文
posted @ 2023-01-20 12:56 383494 阅读(11) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 下一页