Live2D
摘要: 洛谷AC200祭 10-27 阅读全文
posted @ 2019-10-30 14:22 'Jack' 阅读(68) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; #define sd 1000010 int a1,b1,j; int kmp[sd]; char a[sd],b[sd]; int main() { cin>>a+1; cin>>b+1; a1=strlen(a+1); b1=strlen(b+1); for(int i=2;i<=b1;i... 阅读全文
posted @ 2019-10-15 11:05 'Jack' 阅读(92) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; struct yyy{ int t, nex; }e[2*500001]; int depth[500001],fa[500001][22],lg[500001],head[500001]; int tot; void add(int x,int y) //邻接表存树 { e[++tot... 阅读全文
posted @ 2019-10-15 10:57 'Jack' 阅读(109) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int n; string s; struct jhh { int fail; int vis[26]; int end; }a[100001]; int cnt=0; void build(string s) { int l=s.length(); int now=0; for(int i=0;iq; ... 阅读全文
posted @ 2019-10-15 10:56 'Jack' 阅读(136) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstdio> #define MAXN 1000001 #define ll long long using namespace std; unsigned ll n,m,a[MAXN],ans[MAXN<<2],tag[MAXN<<2]; inline ll ls(ll x) { return x<<1; } inline ll rs(l 阅读全文
posted @ 2019-10-15 10:55 'Jack' 阅读(104) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; const int maxn=11000002; char a[maxn<<1]; int p[maxn<<1]; int cnt=1,rd,mid,ans; void read() { char c=getchar(); a[0]='~'; a[1]='|'; while(c>='a'&&c<='z') { 阅读全文
posted @ 2019-10-15 10:54 'Jack' 阅读(92) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; const int maxn=11000002; char a[maxn<<1]; int p[maxn<<1]; int cnt=1,rd,mid,ans; void read() { char c=getchar(); a[0]='~'; a[1]='|'; while(c>='a'&&c<='z') { 阅读全文
posted @ 2019-10-15 10:52 'Jack' 阅读(91) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; int pow_mod(int a, int n, int m) { long long ans = 1; while(n){ if(n&1){ ans = (ans * a) % m; } a = (a * 阅读全文
posted @ 2019-10-15 10:49 'Jack' 阅读(69) 评论(0) 推荐(0) 编辑
摘要: NOIP模拟赛考试总结 这两天我们进行了以小奇为主题的NOIP模拟赛 考试总结: 第一题 看出是一个DP,但是前面的决策对后面有影响,百思不得其解时想到后面决策对前面没有影响,所以从后面开始DP,每步取MAX。 第二题 看了半天都不会,交了一个暴力算法,得了0分,因为我把前缀和取模了,比如 1 2 阅读全文
posted @ 2019-10-07 09:22 'Jack' 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 这道题一看就是一道树形dp的题目。 我们首先设f[i][1]表示第i个点选择,f[i][0]表示不选。 由此可以得出状态转移方程 当第i个点不放时,它的儿子必须放,所以f[i][0]+=f[to][1] to为i的子节点。 当第i个点放时,它的儿子可以也可以不放,我们取最小值f[i][1]+=min 阅读全文
posted @ 2019-07-19 09:39 'Jack' 阅读(131) 评论(0) 推荐(0) 编辑