2016-2017 CT S03E07: Codeforces Trainings Season 3 Episode 7
A. Yet Another Problem with Strings
题意:
给出$n$个字符串$S_i$,要求支持两种操作:
- 在第$i$个字符串后增加一个字符$c$
- 给出一个字符串$T$,询问是否有一个串$S_i$是$T$的子串。
强制在线,保证$\sum S_i, \sum T \leq 2 \cdot 10^5$
思路:
考虑暴力做法即枚举每个$S_i$然后询问$T$中的每个等长的子串是否等于$S_i$。
但是一个小优化是可以把所有长度相同的$S_i$放在一起做,用std::map记录哈希值。
并且注意到$\sum S_i \leq 2 \cdot 10^5$,所以所有的$S_i$只有$\sqrt{2 \cdot 10^5}$种长度。
暴力即可。
B. Pen Pineapple Apple Pen
Solved.
题意:将一个序列合并成一个数。
思路:分类讨论一下, 水。
#include<bits/stdc++.h> using namespace std; const int maxn = 1e5 + ; char str[maxn]; bool solve()
{
int len = strlen(str + );
if(len == ) return true;
while(len % == ) len = len >> ;
if(len != ) return false;
len = strlen(str + );
for(int i = ; i <= len; i += ) if(str[i] != 'P' && str[i + ] != 'P') return false;
return true;
} int main()
{
int t;
scanf("%d", &t);
while(t--)
{
scanf("%s", str + );
puts(solve() ? "YES" : "NO");
}
return ;
}
C. Stickmen
Solved.
题意:找有几个小人
思路:枚举$i, j$两个点作为中间那条线的端点, 再枚举公共点计算贡献。
#include<bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9 + ;
const int maxn = 1e3; int n, m;
ll fac[maxn];
ll inv[maxn];
ll invfac[maxn];
int du[maxn];
int mp[maxn][maxn]; void Init()
{
fac[] = inv[] = invfac[] = ;
fac[] = inv[] = invfac[] = ;
for(int i = ; i < maxn; ++i)
{
fac[i] = fac[i - ] * i % MOD;
inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD;
invfac[i] = invfac[i - ] * inv[i] % MOD;
}
} ll C(int n, int m)
{
if(n < || m < ) return ;
if(m > n) return ;
return fac[n] * invfac[m] % MOD * invfac[n - m] % MOD;
} int merge(int x, int y)
{
int res = ;
for(int i = ; i <= n; ++i) if(mp[x][i] == && mp[y][i] == ) res++;
return res;
} int main()
{
Init();
while(~scanf("%d %d", &n, &m))
{
memset(mp, , sizeof mp);
memset(du, , sizeof du);
for(int i = , x, y; i <= m; ++i)
{
scanf("%d %d", &x, &y);
du[x]++, du[y]++;
mp[x][y] = mp[y][x] = ;
}
ll ans = ;
for(int i = ; i <= n; ++i) for(int j = ; j <= n; ++j) if(mp[i][j] && i != j)
{
int x = du[i] - , y = du[j] - ;
int same = merge(i, j);
ans = (ans + C(x, ) * C(y, ) % MOD)% MOD; ans = (ans - C(x - , ) * C(y - , ) % MOD * same % MOD) % MOD;
ans = (ans + C(x - , ) * C(same, ) % MOD) % MOD;
}
printf("%lld\n", ans);
}
return ;
}
D. Strange Queries
Solved.
题意:询问$i \in [L_1, R_1],j \in [L_2, R_2] 有多少对(i, j) 使得 a_i = a_j$
思路:$f[i][j]表示第i个块对前j个块的贡献,f2[i][j]表示a_i对前j个块的贡献$
$整块整块处理,边边角角处理$
#include <bits/stdc++.h>
using namespace std; #define ll long long
#define N 50010
#define S 150
#define unit 450
int n, a[N], q;
int pos[N], posl[unit], posr[unit];
ll f[unit][unit], f2[N][unit];
int cnt[N]; int main()
{
while (scanf("%d", &n) != EOF)
{
for (int i = ; i <= n; ++i) pos[i] = (i - ) / S + ;
for (int i = ; i <= n; ++i)
{
if (i == || pos[i] != pos[i - ])
posl[pos[i]] = i;
// cout << i << " " << pos[i] << endl;
posr[pos[i]] = i;
// printf("%d %d\n", posl[pos[i]], posr[pos[i]]);
}
// for (int i = 1; i <= n; ++i) cout << i << " " << pos[i] << endl;
// for (int i = 1; i <= n; ++i)
// printf("%d %d\n", posl[pos[i]], posr[pos[i]]);
memset(f, , sizeof f);
memset(f2, , sizeof f2);
memset(cnt, , sizeof cnt);
for (int i = ; i <= n; ++i) scanf("%d", a + i);
for (int i = ; i <= pos[n]; ++i)
{
for (int j = posl[i]; j <= posr[i]; ++j)
++cnt[a[j]];
for (int j = ; j <= n; ++j)
{
f[i][pos[j]] += cnt[a[j]];
f2[j][i] += cnt[a[j]];
}
for (int j = posl[i]; j <= posr[i]; ++j)
--cnt[a[j]];
}
for (int i = ; i <= pos[n]; ++i)
for (int j = ; j <= pos[n]; ++j)
f[i][j] += f[i][j - ];
for (int i = ; i <= n; ++i)
for (int j = ; j <= pos[n]; ++j)
f2[i][j] += f2[i][j - ];
scanf("%d", &q);
int l[], r[];
while (q--)
{
for (int i = ; i < ; ++i)
scanf("%d%d", l + i, r + i);
if (pos[l[]] == pos[r[]])
{
swap(l[], l[]);
swap(r[], r[]);
}
ll res = ;
if (pos[l[]] == pos[r[]])
{
if (pos[l[]] == pos[r[]])
{
for (int i = l[]; i <= r[]; ++i)
++cnt[a[i]];
for (int i = l[]; i <= r[]; ++i)
res += cnt[a[i]];
for (int i = l[]; i <= r[]; ++i)
--cnt[a[i]];
}
else
{
int L = pos[l[]] + ;
int R = pos[r[]] - ;
for (int i = l[]; i <= r[]; ++i)
{
res += f2[i][R] - f2[i][L - ];
++cnt[a[i]];
}
for (int i = l[]; i <= posr[pos[l[]]]; ++i)
res += cnt[a[i]];
for (int i = posl[pos[r[]]]; i <= r[]; ++i)
res += cnt[a[i]];
for (int i = l[]; i <= r[]; ++i)
--cnt[a[i]];
}
}
else
{
int L[] = {pos[l[]] + , pos[l[]] + };
int R[] = {pos[r[]] - , pos[r[]] - };
for (int i = L[]; i <= R[]; ++i)
res += f[i][R[]] - f[i][L[] - ];
for (int i = l[]; i <= posr[pos[l[]]]; ++i)
{
res += f2[i][R[]] - f2[i][L[] - ];
++cnt[a[i]];
}
for (int i = posl[pos[r[]]]; i <= r[]; ++i)
{
res += f2[i][R[]] - f2[i][L[] - ];
++cnt[a[i]];
}
for (int i = l[]; i <= posr[pos[l[]]]; ++i)
{
res += f2[i][R[]] - f2[i][L[] - ];
res += cnt[a[i]];
}
for (int i = posl[pos[r[]]]; i <= r[]; ++i)
{
res += f2[i][R[]] - f2[i][L[] - ];
res += cnt[a[i]];
}
for (int i = l[]; i <= posr[pos[l[]]]; ++i)
--cnt[a[i]];
for (int i = posl[pos[r[]]]; i <= r[]; ++i)
--cnt[a[i]];
}
printf("%lld\n", res);
}
}
return ;
}
E. Bravebeart
Solved.
题意:给出n个人和n匹马, 每个人和每匹马都有自己的能力值, 每个人选择一匹马, 那么每个人的权值就是个人能力值乘上马的权值, 求是否存在一种方案, 使得第一个人的权值最大。
思路:排序, 水
#include<bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f;
const int maxn = 1e5 + ; int n;
int w[maxn], h[maxn]; bool solve(int tmp)
{
for(int i = n - ; i >= ; --i)
{
if(w[i] * h[n - - i + ] >= tmp) return false;
}
return true;
} int main()
{
int t;
scanf("%d", &t);
while(t--)
{
scanf("%d", &n);
for(int i = ; i <= n; ++i) scanf("%d", w + i);
for(int i = ; i <= n; ++i) scanf("%d", h + i);
int tmp = w[];
w[] = INF;
sort(w + , w + + n);
sort(h + , h + + n);
tmp *= h[n];
puts(solve(tmp) ? "YES" : "NO");
}
return ;
}
F. GukiZ Height
Solved.
题意:$f_i = f_{i - 1} + a_{(i - 1) \% n +1}, g_i = h - \frac{i \cdot (i + 1)}{2}, 求最小的i 使得 f_i >= g_i$
思路:枚举每个余数, 那么分为周期为0和周期>=1, 对于后面一种情况, 二分周期。
#include <bits/stdc++.h>
using namespace std; #define ll long long
#define N 100010
int n;
ll h, a[N];
ll sum[N]; bool check(ll x, int remind)
{
ll day = x * n + remind;
return h - (day * (day + )) / <= sum[n] * x + sum[remind];
} int main()
{
while (scanf("%d%lld", &n, &h) != EOF)
{
sum[] = ;
for (int i = ; i <= n; ++i) scanf("%lld", a + i);
for (int i = ; i <= n; ++i) sum[i] = sum[i - ] + a[i];
ll ans = (ll)1e18;
for (int i = ; i <= n; ++i) if(sum[i] >= h - (i * (i + ) / )) ans = min(ans, 1ll * i);
for (int i = ; i <= n; ++i)
{
ll l = , r = (2e9 + ) / n, res = -;
while (r - l >= )
{
ll mid = (l + r) >> ;
// cout << i << " " << mid << endl;
if (check(mid, i))
{
r = mid - ;
res = mid;
}
else
l = mid + ;
}
// cout << i << " " << res << endl;
if (res != -)
ans = min(ans, res * n + i);
}
printf("%lld\n", ans);
}
return ;
}
I. Prime Moving
Solved.
题意:将素数$a$通过某系列变化得到素数$b$, 每次变化可以加上或减去一个素数, 同时结果要求是素数。
思路:将2作为中间点, 各种分类
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int S = ; ll mult_mod(ll a, ll b, ll c)
{
a %= c;
b %= c;
ll ret = ;
ll tmp = a;
while(b)
{
if(b & )
{
ret += tmp;
if(ret > c) ret -= c;
}
tmp <<= ;
if(tmp > c) tmp -= c;
b >>= ;
}
return ret;
} ll pow_mod(ll a, ll n, ll mod)
{
ll ret = ;
ll tmp = a % mod;
while(n)
{
if(n & ) ret = mult_mod(ret, tmp, mod);
tmp = mult_mod(tmp, tmp, mod);
n >>= ;
}
return ret;
} bool check(ll a, ll n, ll x, ll t)
{
ll ret = pow_mod(a, x, n);
ll last = ret;
for(int i = ; i <= t; ++i)
{
ret = mult_mod(ret, ret, n);
if(ret == && last != && last != n - ) return true;
last = ret;
}
if(ret != ) return true;
else return false;
} bool is_Prime(ll n)
{
if(n < ) return false;
if(n == ) return true;
if((n & ) == ) return false;
ll x = n - ;
ll t = ;
while((x & ) == ) { x >>= ; ++t; }
srand(time(NULL));
for(int i = ; i < S; ++i)
{
ll a = rand() % (n - ) + ;
if(check(a, n, x, t)) return false;
}
return true;
} ll a, b; void solve()
{
if(a == )
{
if(is_Prime(b - ))
{
printf("%lld->%lld\n", a, b);
return ;
}
if(is_Prime(b + ))
{
printf("%lld->%lld->%lld\n", a, b + , b);
return ;
}
}
else
{
if(b == a + )
{
printf("%lld->%lld\n", a, b);
return ;
}
if(b == a + && is_Prime(a + ))
{
if(is_Prime(a - ) && is_Prime(b - ))
{
puts("Poor Benny");
return ;
}
else
{
printf("%lld->%lld->%lld\n", a, a + , b);
return ;
}
}
if(is_Prime(a - ))
{
if(is_Prime(b - ))
{
printf("%lld->%lld->%lld\n", a, 2ll, b);
return ;
}
if(is_Prime(b + ))
{
if(is_Prime(a + ) && is_Prime(b - ))
{
puts("Poor Benny");
return ;
}
else
{
printf("%lld->%lld->%lld->%lld\n", a, 2ll, b + , b);
return ;
}
}
}
if(is_Prime(a + ))
{
if(is_Prime(b - ))
{
printf("%lld->%lld->%lld->%lld\n", a, a + , 2ll, b);
return ;
}
if(is_Prime(b + ))
{
printf("%lld->%lld->%lld->%lld->%lld\n", a, a + , 2ll, b + , b);
return ;
}
}
}
puts("Unlucky Benny");
} int main()
{
while(~scanf("%lld %lld", &a, &b))
{
solve();
}
return ;
}
J. Valentina and the Gift Tree
Upsolved
题意:给出一棵树,询问$a -> b的简单路径上组成的序列的最大子段和$
思路:把一条简单路径拆成两条链,单独处理,一条链上用树链剖分处理,合并的时候注意左右端点怎么接
#include <bits/stdc++.h>
using namespace std; #define ll long long
#define N 100010
#define D 20
#define INF 0x3f3f3f3f3f3f3f3f
int n, q, g[N];
vector <int> G[N]; int sze[N], top[N], fa[D][N], son[N], p[N], fp[N], deep[N], cnt;
void DFS(int u)
{
sze[u] = ;
for (int i = ; i < D; ++i)
fa[i][u] = fa[i - ][fa[i - ][u]];
for (auto v : G[u]) if (v != fa[][u])
{
fa[][v] = u;
deep[v] = deep[u] + ;
DFS(v);
sze[u] += sze[v];
if (!son[u] || sze[v] > sze[son[u]]) son[u] = v;
}
} void gettop(int u, int sp)
{
top[u] = sp;
p[u] = ++cnt;
fp[cnt] = u;
if (!son[u]) return;
gettop(son[u], sp);
for (auto v : G[u]) if (v != fa[][u] && v != son[u])
gettop(v, v);
} namespace SEG
{
struct node
{
ll lmax, rmax, Max, sum;
node () {}
void init()
{
lmax = rmax = Max = sum = -INF;
}
node operator + (const node &other) const
{
node res; res.init();
if (lmax == -INF || rmax == -INF)
return other;
if (other.lmax == -INF || other.rmax == -INF)
return *this;
res.sum = sum + other.sum;
res.lmax = max(lmax, sum + other.lmax);
res.rmax = max(other.rmax, other.sum + rmax);
res.Max = max(Max, other.Max);
res.Max = max(res.Max, rmax + other.lmax);
return res;
}
}a[N << ], ans[], tmp;
void build(int id, int l, int r)
{
a[id].init();
if (l == r)
{
a[id].lmax = a[id].rmax = a[id].sum = a[id].Max = g[fp[l]];
return;
}
int mid = (l + r) >> ;
build(id << , l, mid);
build(id << | , mid + , r);
a[id] = a[id << ] + a[id << | ];
}
void query(int id, int l, int r, int ql, int qr)
{
if (qr < ql || ql <= || qr <= ) return;
if (l >= ql && r <= qr)
{
tmp = tmp + a[id];
return;
}
int mid = (l + r) >> ;
if (ql <= mid) query(id << , l, mid, ql, qr);
if (qr > mid) query(id << | , mid + , r, ql, qr);
}
} int lca(int u, int v)
{
while (top[u] != top[v])
{
if (deep[top[u]] < deep[top[v]]) swap(u, v);
u = fa[][top[u]];
}
if (deep[u] > deep[v]) swap(u, v);
return u;
} int kth(int u, int k)
{
for (int i = ; i < D; ++i)
if ((k >> i) & )
u = fa[i][u];
return u;
} void query(int u, int v, int vis)
{
SEG::ans[vis].init();
while (top[u] != top[v])
{
if (deep[top[u]] < deep[top[v]]) swap(u, v);
SEG::tmp.init();
SEG::query(, , n, p[top[u]], p[u]);
SEG::ans[vis] = SEG::tmp + SEG::ans[vis];
u = fa[][top[u]];
}
if (deep[u] > deep[v]) swap(u, v);
SEG::tmp.init();
SEG::query(, , n, p[u], p[v]);
SEG::ans[vis] = SEG::tmp + SEG::ans[vis];
} int main()
{
while (scanf("%d", &n) != EOF)
{
for (int i = ; i <= n; ++i) G[i].clear();
memset(son, , sizeof son); cnt = ; deep[] = ;
for (int i = , u, v; i < n; ++i)
{
scanf("%d%d", &u, &v);
G[u].push_back(v);
G[v].push_back(u);
}
for (int i = ; i <= n; ++i) scanf("%d", g + i);
deep[] = ; fa[][] = ;
DFS(); gettop(, ); SEG::build(, , n);
//if (n == 10) return 0;
scanf("%d", &q);
int a, b;
while (q--)
{
scanf("%d%d", &a, &b);
if (deep[a] > deep[b]) swap(a, b);
int Lca = lca(a, b);
if (a == Lca)
query(a, b, );
else
{
query(Lca, a, );
query(kth(b, deep[b] - deep[Lca] - ), b, );
swap(SEG::ans[].lmax, SEG::ans[].rmax);
SEG::ans[] = SEG::ans[] + SEG::ans[];
}
printf("%lld\n", SEG::ans[].Max);
}
}
return ;
}
LCA
#include<bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9 + ;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e5 + ; const int DEG = ; struct Edge {
int to, nxt;
Edge() {}
Edge(int to, int nxt) :to(to), nxt(nxt) {}
}edge[maxn << ]; struct node {
ll lmax, rmax, ans, sum;
node()
{
sum = ;
lmax = rmax = ans = -INFLL;
}
node(ll tmp)
{
lmax = rmax = ans = sum = tmp;
}
node operator + (const node &other) const
{
node res;
res.sum = sum + other.sum;
res.lmax = max(lmax, sum + other.lmax);
res.rmax = max(other.rmax, other.sum + rmax);
res.ans = max(max(ans, other.ans), rmax + other.lmax);
return res;
}
}; int n, m;
ll arr[maxn];
int head[maxn], tot;
node res[maxn][DEG];
int fa[maxn][DEG];
int deg[maxn]; void Init()
{
tot = ;
memset(fa, -, sizeof fa);
memset(head, -, sizeof head);
} void addedge(int u, int v)
{
edge[tot] = Edge(v, head[u]); head[u] = tot++;
edge[tot] = Edge(u, head[v]); head[v] = tot++; } void BFS(int root)
{
queue<int>q;
deg[root] = ;
res[root][] = node(arr[root]);
fa[root][] = root;
q.push(root);
while (!q.empty())
{
int tmp = q.front();
q.pop();
for (int i = ; i < DEG; ++i)
{
fa[tmp][i] = fa[fa[tmp][i - ]][i - ];
res[tmp][i] = res[tmp][i - ] + res[fa[tmp][i - ]][i - ];
}
for (int i = head[tmp]; ~i; i = edge[i].nxt)
{
int v = edge[i].to;
if (v == fa[tmp][]) continue;
deg[v] = deg[tmp] + ;
fa[v][] = tmp;
res[v][] = node(arr[v]);
q.push(v);
}
}
} node LCA(int u, int v)
{
if (deg[u] > deg[v]) swap(u, v);
int hu = deg[u], hv = deg[v];
int tu = u, tv = v;
node ansu, ansv;
for (int det = hv - hu, i = ; det; det >>= , ++i)
{
if (det & )
{
ansv = ansv + res[tv][i];
tv = fa[tv][i];
}
}
for (int i = DEG - ; i >= ; --i)
{
if (fa[tu][i] == fa[tv][i]) continue;
ansu = ansu + res[tu][i];
ansv = ansv + res[tv][i];
tu = fa[tu][i];
tv = fa[tv][i];
}
while (tu != tv)
{
ansu = ansu + res[tu][];
ansv = ansv + res[tv][];
tu = fa[tu][];
tv = fa[tv][];
}
swap(ansv.lmax, ansv.rmax);
return ansu + res[tu][] + ansv;
} void RUN()
{
while (~scanf("%d", &n))
{
Init();
for (int i = , u, v; i < n; ++i)
{
scanf("%d %d", &u, &v);
addedge(u, v);
}
for (int i = ; i <= n; ++i) scanf("%lld", arr + i);
BFS();
int q;
scanf("%d", &q);
for (int qq = , u, v; qq <= q; ++qq)
{
scanf("%d %d", &u, &v);
printf("%lld\n", LCA(u, v).ans);
}
}
} int main()
{
#ifdef LOCAL_JUDGE
freopen("Text.txt", "r", stdin);
#endif // LOCAL_JUDGE RUN(); #ifdef LOCAL_JUDGE
fclose(stdin);
#endif // LOCAL_JUDGE
return ;
}
2016-2017 CT S03E07: Codeforces Trainings Season 3 Episode 7的更多相关文章
- 2016-2017 CT S03E07: Codeforces Trainings Season 3 Episode 7 - HackerEarth Problems Compilation
B: 思路: 暴力,每两个判断一下; C: 思路: 容斥定理,先枚举脖子下面那个点和那个不可描述的点,算出所有的方案数,这里面有多的腿当成了脖子或者胳膊的,然后就再枚举这种情况把这些减去,又减多了; ...
- 2016-2017 CT S03E06: Codeforces Trainings Season 3 Episode 6(8/13)
2016-2017 CT S03E06: Codeforces Trainings Season 3 Episode 6 比赛连接: http://codeforces.com/gym/101124/ ...
- 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 (2016 Stanford Local Programming Contest, Extended) E
链接:http://codeforces.com/gym/101116 学弟写的,以后再补 #include <iostream> #include <algorithm> # ...
- 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 (2016 Stanford Local Programming Contest, Extended) J
链接:http://codeforces.com/gym/101116 题意:给出n个点,要求一个矩形框将(n/2)+1个点框住,要面积最小 解法:先根据x轴选出i->j之间的点,中间的点(包括 ...
- 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 (2016 Stanford Local Programming Contest, Extended) I
链接:http://codeforces.com/gym/101116 题意:选六个数,必须出现次数最多,且数字最小,如果出现7优先加入7 解法:排序,出现7优先加入7,最后再将6个数排序 #incl ...
- 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 (2016 Stanford Local Programming Contest, Extended) B
链接:http://codeforces.com/gym/101116 学弟做的,以后再补 #include <iostream> #include <stdio.h> #in ...
- 2016-2017 CT S03E02: Codeforces Trainings Season 3 Episode 2
A HHPaint B Square Root C Interesting Places D Road to Home E Ant and apples F Square G Pair H The F ...
- 2016-2017 CT S03E06: Codeforces Trainings Season 3 Episode 6 The Baguette Master
比赛看不懂 之后不确定题意去瞄了题解,需要分类讨论?囧 之后按照队友已经ac的题意 就是求外面一圈周长,直接可以求得 #include<bits/stdc++.h> using names ...
- 2014-2015 Codeforces Trainings Season 2 Episode 7 G Gophers --线段树
题意: 有n个地鼠,m个CD碟,每个CD碟有一个影响范围,范围内的地鼠都会被吵到,每次有一个操作就是移动CD碟,然后求每次被影响的地鼠有多少只. 解法: 线段树做.我们只关注地鼠有没有被吵到就可以了, ...
随机推荐
- python2.0_s12_day13_javascript&Dom&jQuery
今天主要内容:JavaScriptDomjQuery http://www.cnblogs.com/wupeiqi/articles/5369773.html 今天主要内容大致了解:javascrip ...
- 【RF库Collections测试】Dictionary Should Not Contain Value
Name:Dictionary Should Not Contain ValueSource:Collections <test library>Arguments:[ dictionar ...
- Oracle 12C卸载图文教程
第一步:找到自己的Oracle安装目录.我的目录是:D:\app\u01\product\12.1.0\dbhome_1\deinstall ,然后点击bat文件.出现如下等待画面. 第二步:耐心 ...
- jQuery回溯
1.jQuery有个很好用的方法是 end(); 2.在进行链式操作时,使用end方法,可以回溯到上一个jQuery对象. 3.实现原理: jQuery内部有一个对象栈,当形成新的对象时,会将新对象推 ...
- chrome中image图片预留位置的问题
在项目中发现,当设置 <img src="" width="100" height="100"> 通过设置img的width属性 ...
- chrome单步调试代码
单步调试代码 所有步骤选项均通过边栏中的可点击图标 表示,但也可以通过快捷键触发(鼠标悬停在操作图标上就可以看到快捷键).下面是简要介绍: 图标/按钮 操作 描述 Resume 继续执行直到下一个断点 ...
- mysql max_allowed_packet参数值改大后,莫名被还原
mysql数据库用innodb引擎,mysql max_allowed_packet在my.cnf中值加大后,够一段时间,系统会莫名把这个参数的值改小. innodb_buffer_pool_size ...
- MySQL 慢查询日志工具之pt-query-digest
1. 工具简介 pt-query-digest是用于分析mysql慢查询的一个工具,它可以分析binlog.General log.slowlog,也可以通过SHOWPROCESSLIST或者通过tc ...
- Nginx文件下载服务器
1. 配置文件 server { listen 80; #端口 server_name localhost; #服务名 charset utf-8; #避免中文乱码 root /data/packag ...
- AC自动机板子题/AC自动机学习笔记!
想知道484每个萌新oier在最初知道AC自动机的时候都会理解为自动AC稽什么的,,,反正我记得我当初刚知道这个东西的时候,我以为是什么神仙东西,,,(好趴虽然确实是个对菜菜灵巧比较难理解的神仙知识点 ...