上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页
摘要: exgcd $$ x = y \ \ y = t - a /b \times y$$ CRT \(ans = \sum_{i = 1}^n{b_i\times M_i\times inv(M_i,mod_i)}\) \(M_k=(\prod_{i=1}^n {} mod_i)/mod_k\) \(i 阅读全文
posted @ 2020-07-25 20:14 HN-wrp 阅读(108) 评论(0) 推荐(0) 编辑
摘要: struct PAM { int ch[N][26], fail[N], len[N]; int tot, las; PAM() { len[0] = 0; len[1] = -1; fail[0] = 1; tot = 1; las = 0; } inline int gtfail(int x, 阅读全文
posted @ 2020-07-23 16:09 HN-wrp 阅读(69) 评论(0) 推荐(0) 编辑
摘要: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define R register #define LL long long const int inf = 0x3f3f3f3f; con 阅读全文
posted @ 2020-07-22 09:00 HN-wrp 阅读(125) 评论(0) 推荐(0) 编辑
摘要: #include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <cstdlib> #include <string> #include <fstream> using namespace st 阅读全文
posted @ 2020-06-17 18:00 HN-wrp 阅读(203) 评论(0) 推荐(0) 编辑
摘要: #define ls(x) ch[x][0] #define rs(x) ch[x][1] int fa[N], ch[N][2], sum[N], val[N], rev[N]; inline void update(int x) { sum[x] = sum[ls(x)] ^ sum[rs(x) 阅读全文
posted @ 2020-06-16 10:16 HN-wrp 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 题目链接 首先一个很显然的想法就是直接$DP$ 设$f[i][j][k]$表示抓前$i$个神奇宝贝用了$j$个宝贝球和$k$个超级球,有: \(f[i][j][k] = max (f[i - 1][j - 1][k] + p[i], f[i - 1][j][k - 1] + u[i], f[i - 阅读全文
posted @ 2020-06-10 17:13 HN-wrp 阅读(469) 评论(0) 推荐(1) 编辑
摘要: //#include<bits/stdc++.h> #include<iostream> #include<iomanip> #include<cstring> #include<stack> #include<string> #include<map> #include<cstdlib> #inc 阅读全文
posted @ 2020-06-09 18:18 HN-wrp 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Luogu P3195 [HNOI2008]玩具装箱 Luogu P2900 [USACO08MAR]Land Acquisition G Luogu P5785 [SDOI2012]任务安排 Luogu P4360 [CEOI2004]锯木厂选址 Luogu P2120 [ZJOI2007]仓库建 阅读全文
posted @ 2020-06-07 18:41 HN-wrp 阅读(133) 评论(0) 推荐(0) 编辑
摘要: "「JOISC 2016 Day 3」回转寿司" 这题我无力吐槽了... ~~强烈谴责出题人用脚造数据~~ 解法 其实这题主要还是部分分启发正解吧。看到有个$s_i = 1, t_i= n$的做法就是维护一个堆就可以了,所以扩展下就是分块,然后每个块维护一个堆。散块暴力,大块直接查。但是有个很坑爹的 阅读全文
posted @ 2020-05-18 20:51 HN-wrp 阅读(200) 评论(0) 推荐(0) 编辑
摘要: "「JOISC 2016 Day 2」三明治" 这题真正让我感受了记搜的强大。 ~~我真的没想过搜索可以过$400$的啊喂~~ ~~对,$\text{NOI}$还可以过$1e5$呢~~ 解法 一个~~并不~~显然的$n^4$的做法是枚举每一个点,然后上下左右记忆化搜索。考试的时候觉得难打,但是~~看 阅读全文
posted @ 2020-05-18 20:49 HN-wrp 阅读(336) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页