2 Zaller

尚未进行身份认证

我要认证

菜鸡修炼ing... 整年都在线,博客若有看不懂的或者不对的地方,直接私信我就行

等级
TA的排名 6w+

【模板】树哈希

OI Wiki - 树哈希板子#include <bits/stdc++.h>using namespace std;typedef unsigned long long ull;typedef long long ll;const int INF = 0x3f3f3f3f;const ll inf = (1ll << 60);const int N = 1e6 + 10;vector<int> e[N];int n, m;namespace

2020-10-08 19:43:02

P3690 【模板】Link Cut Tree (动态树lct)

学习资源https://www.cnblogs.com/flashhu/p/8324551.html中序遍历Splay得到的每个点的深度序列严格递增题目P3690 【模板】Link Cut Tree (动态树)数组版代码#include <bits/stdc++.h>using namespace std;const int N = 1e6 + 10;int n, m, k;namespace LCT { // lct板子 int v[N];// 点权

2020-09-19 21:12:57

2017 ACM/ICPC Asia Regional Shenyang Online

目录6194 string string string 后缀自动机 - 求恰好出现k次的字符串6201 transaction transaction transaction 树形dp + 换根6205 card card card6194 string string string 后缀自动机 - 求恰好出现k次的字符串hdu 6194 string string string#include <bits/stdc++.h>int k;using namespace std;

2020-09-19 14:00:42

2017ACM/ICPC亚洲区沈阳站-重现赛(感谢东北大学)

目录6222 Heron and His Triangle · 找规律 + 暴力求线性递推式系数6225 Little Boxes6227 Rabbits6228 Tree6217 BBP Formula6218 Bridge6219 Empty Convex Polygons6220 Defense of the Ancients6221 Five-round Show Hand6222 Heron and His Triangle · 找规律 + 暴力求线性递推式系数hdu 6222 H

2020-09-16 21:35:18

P3690 【模板】Link Cut Tree (动态树)

学习博客https://www.cnblogs.com/flashhu/p/8324551.html题目代码#include <bits/stdc++.h>using namespace std;const int N = 1e6 + 10;int n, m, k;namespace LCT { // lct板子 int v[N];// 点权 int f[N];// 父节点 int st[N];//栈 int c[N][2];// 每个

2020-09-15 15:39:08

2020 Multi-University Training Contest 8

Auto-correctionBreaking Down NewsClockwise or Counterclockwise#include <bits/stdc++.h>using namespace std;typedef long long ll;int main() { int t; scanf("%d", &t); while (t--) { ll x1, y1, x2, y2, x3, y3; scan

2020-08-22 19:13:00

2020 Multi-University Training Contest 7

Animism Bitwise Xor Counting Decision Expectation FlowerGame Heart Increasing and DecreasingJoggingKcats

2020-08-22 19:09:58

2020 Multi-University Training Contest 10

Anti-hash TestNetwork TestMine Sweeper随机生成#include <bits/stdc++.h>using namespace std;#define between(x, a, b) (a<=x && x<=b)const int dir[8][2] = {1, 0, 0, 1, -1, 0, 0, -1, -1, -1, -1, 1, 1, -1, 1, 1};int n;map<int, vector

2020-08-20 20:47:49

2020 Multi-University Training Contest 4

1001 Anti-AK ProblemBlow up the Enemy #include <bits/stdc++.h>using namespace std;typedef long long ll;const long long INF = 0x3f3f3f3f3f3f3f3f;const int N = 5e3 + 10;struct wapon { ll a, d; ll val;} s[N];int main() { int t; s

2020-08-18 19:49:42

2020 Multi-University Training Contest 3

Tokitsukaze and Multiple10510^5105 的区间,显然不能用两个for把所有的区间和求出来,将每个前缀和 %p\% p%p,如果前缀和 sum[i] = sum[ i前面某个位置 k],说明 a[k]+a[k+1]+…+a[i] 是 p 的倍数,是可以合并的一个区间,dp找答案最大值#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 1e6 + 1

2020-08-17 21:34:29

2020 Multi-University Training Contest 2

1001 Total Eclipse 1002 Blood Pressure Game 1003 Count on a Tree II Striking Back1004 Diamond Rush1005 New Equipments 1006 The Oculus1007 In Search of Gold 1008 Dynamic Convex Hull 1009 It’s All Squares 1010 Lead of Wisdom 1011 King of Hot Pot

2020-08-15 12:49:36

2020牛客暑期多校训练营(第九场)

Groundhog and 2-Power Representations = input()n = len(s) a = []for i in range(len(s)): if s[i] == '(': a.append(-1) elif s[i] == ')': a.append(-2) elif s[i] == '+': a.append(-3) else: a.append(int(s[i])

2020-08-09 14:30:03

2020 Multi-University Training Contest 6

Road To The 3rd Building期望 = 区间的权值 * 区间出现的次数当 n=3n=3n=3E(x)=∑x×p(x)=a1+12(a1+a2)+13(a1+a2+a3)+a2+12(a2+a3)+a3n(n+1)2E(x)=\sum x\times p(x)=\cfrac{ a_1+\frac{1}{2}(a_1+a_2)+\frac{1}{3}(a_1+a_2+a_3)+a_2+\frac{1}{2}(a_2+a_3)+a_3}{\cfrac{n(n+1)}{2}}E(x)=∑x×

2020-08-06 19:11:00

2020 Multi-University Training Contest 1

Fibonacci Sum赛中交的代码赛后疯狂T,感谢测评姬放过……

2020-08-05 20:32:04

2020牛客暑期多校训练营(第七场)

A Social DistancingB Mask Allocation#include <bits/stdc++.h>using namespace std;const int N = 1e6 + 10;int res[N], tot;int n, m, k;int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int T; cin >> T;

2020-08-05 18:50:09

2020 Multi-University Training Contest 5

Tetrahedron1h2=1a2+1b2+1c2\cfrac{1}{h^2}=\cfrac{1}{a^2}+\cfrac{1}{b^2}+\cfrac{1}{c^2}h21​=a21​+b21​+c21​E(x+y)=E(x)+E(y)E(x+y)=E(x)+E(y)E(x+y)=E(x)+E(y)#include <bits/stdc++.h>using namespace std;typedef long long ll;const ll mod = 998244353;c

2020-08-04 20:43:39

2020牛客暑期多校训练营(第八场)

A All-Star Game B Bon VoyageC Cinema D Disgusting Relationship E Enigmatic Partition F Factorio G. Game SET#include <bits/stdc++.h>using namespace std;const int N = 1e6 + 10;int n;string str[13] = { "one", "two", "three",

2020-08-03 21:11:23

2020牛客暑期多校训练营(第六场)

A African SortB. Binary Vector#include <bits/stdc++.h>using namespace std;typedef long long ll;const ll mod = 1e9 + 7;const int M = 2e7;int n;ll qpow(ll a, ll b) { a %= mod; ll res = 1; while (b) { if (b & 1)res = res

2020-08-02 16:47:02

【模板】异或最小生成树

主要是借用了最小生成树的Boruvka算法的思想:在两个连通块内找到一条最短的路径,连接两个连通块合并成一个连通块那些年我用异或最小生成树做过的题:cf888g2020牛客暑期多校训练营(第五场)B Graph板子#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 1e6 + 10;int n, m, k;namespace XorMST { int

2020-08-02 10:36:06

宁波市多校训练(二)

LCA!任意根求lca:lca(root,u,v)lca(u,v)、lca(root,u)、lca(root,v)三者中深度最大的那个点坑点:cin输入会T#include <bits/stdc++.h>using namespace std;const int N = 1e5 + 10;vector<int> e[N];int n, m, k;int Log[N];//log2(x)int fa[N][20];int dep[N];//树的深度//常数初

2020-08-02 09:34:49

查看更多

勋章 我的勋章
  • 签到新秀
    签到新秀
    累计签到获取,不积跬步,无以至千里,继续坚持!
  • 阅读者勋章Lv1
    阅读者勋章Lv1
    授予在CSDN APP累计阅读博文达到3天的你,是你的坚持与努力,使你超越了昨天的自己。
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 勤写标兵Lv4
    勤写标兵Lv4
    授予每个自然周发布9篇以上(包括9篇)原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。