Sdoi2017试题泛做
Day1
[Sdoi2017]数字表格
推式子的莫比乌斯反演题。
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath> #define maxn 1000010
#define R register
const int mod = 1e9 + ;
int miu[maxn], fib[maxn], g[maxn], pr[maxn / ], prcnt, fp[maxn][];
bool vis[maxn];
inline int qpow(R int base, R int power)
{
R int ret = ;
for (; power; power >>= , base = 1ll * base * base % mod)
power & ? ret = 1ll * ret * base % mod : ;
return ret;
}
int main()
{
miu[] = ; fib[] = ; fib[] = g[] = g[] = ;
for (R int i = ; i < maxn; ++i)
{
fib[i] = (fib[i - ] + fib[i - ]) % mod; g[i] = ;
if (!vis[i]) pr[++prcnt] = i, miu[i] = -;
for (R int j = ; j <= prcnt && i * pr[j] < maxn; ++j)
{
vis[i * pr[j]] = ;
miu[i * pr[j]] = -miu[i];
if (i % pr[j] == )
{
miu[i * pr[j]] = ;
break;
}
}
}
for (R int i = ; i < maxn; ++i)
fp[i][] = qpow(fib[i], mod - ), fp[i][] = , fp[i][] = fib[i];
for (R int i = ; i < maxn; ++i)
for (R int j = i; j < maxn; j += i)
g[j] = 1ll * g[j] * fp[i][miu[j / i] + ] % mod;
for (R int i = ; i < maxn; ++i)
g[i] = (1ll * g[i - ] * g[i]) % mod;
R int T; scanf("%d", &T);
for (; T; --T)
{
R int n, m, ret = ; scanf("%d%d", &n, &m);
for (R int i = , j; i <= n && i <= m; i = j + )
{
j = std::min(n / (n / i), m / (m / i));
ret = 1ll * ret * qpow(1ll * g[j] * qpow(g[i - ], mod - ) % mod, 1ll * (n / i) * (m / i) % (mod - )) % mod;
}
printf("%d\n", ret);
}
return ;
}
D1T1
[Sdoi2017]树点涂色
LCT套线段树。
#include <cstdio>
#include <cstring> #define R register
#define maxn 100010
#define dmax(_a, _b) ((_a) > (_b) ? (_a) : (_b))
#define cmax(_a, _b) (_a < (_b) ? _a = (_b) : 0)
struct Edge {
Edge *next;
int to;
} *last[maxn], e[maxn << ], *ecnt = e;
inline void link(R int a, R int b)
{
*++ecnt = (Edge) {last[a], b}; last[a] = ecnt;
*++ecnt = (Edge) {last[b], a}; last[b] = ecnt;
}
int son[maxn], size[maxn], fa[maxn], top[maxn], dfn[maxn], pos[maxn], timer, dep[maxn], rig[maxn], n;
bool vis[maxn];
void dfs1(R int x)
{
vis[x] = ; size[x] = ; dep[x] = dep[fa[x]] + ;
for (R Edge *iter = last[x]; iter; iter = iter -> next)
if (!vis[iter -> to])
{
fa[iter -> to] = x;
dfs1(iter -> to);
size[x] += size[iter -> to];
size[son[x]] < size[iter -> to] ? son[x] = iter -> to : ;
}
}
void dfs2(R int x)
{
vis[x] = ; top[x] = son[fa[x]] == x ? top[fa[x]] : x; dfn[x] = ++timer; pos[timer] = x;
for (R Edge *iter = last[x]; iter; iter = iter -> next)
if (vis[iter -> to]) dfs2(iter -> to);
rig[x] = timer;
}
inline int getlca(R int a, R int b)
{
while (top[a] != top[b])
{
dep[top[a]] < dep[top[b]] ? b = fa[top[b]] : a = fa[top[a]];
}
return dep[a] < dep[b] ? a : b;
}
int tr[maxn << ], tag[maxn << ], ql, qr, qv;
inline void update(R int o) {tr[o] = dmax(tr[o << ], tr[o << | ]);}
inline void pushdown(R int o)
{
if (tag[o])
{
tr[o << ] += tag[o]; tag[o << ] += tag[o];
tr[o << | ] += tag[o]; tag[o << | ] += tag[o];
tag[o] = ;
}
}
void build(R int o, R int l, R int r)
{
if (l == r) { tr[o] = dep[pos[l]]; return ;}
R int mid = l + r >> ;
build(o << , l, mid); build(o << | , mid + , r);
update(o);
}
void modify(R int o, R int l, R int r)
{
if (ql <= l && r <= qr)
{
tag[o] += qv; tr[o] += qv; return ;
}
R int mid = l + r >> ;
pushdown(o);
if (ql <= mid) modify(o << , l, mid);
if (mid < qr) modify(o << | , mid + , r);
update(o);
}
int query(R int o, R int l, R int r)
{
if (ql <= l && r <= qr) return tr[o];
R int mid = l + r >> , ret = , tmp;
pushdown(o);
if (ql <= mid) tmp = query(o << , l, mid), cmax(ret, tmp);
if (mid < qr) tmp = query(o << | , mid + , r), cmax(ret, tmp);
update(o);
return ret;
}
struct Node *null;
struct Node {
Node *ch[], *fa, *mx;
inline bool type()
{
return fa -> ch[] == this;
}
inline bool check()
{
return fa -> ch[type()] == this;
}
inline void update()
{
mx = ch[] != null ? ch[] -> mx : this;
}
inline void rotate()
{
R Node *f = fa, *gf = f -> fa; R bool d = type();
(f -> ch[d] = ch[!d]) != null ? ch[!d] -> fa = f, : ;
(fa = gf), f -> check() ? gf -> ch[f -> type()] = this : ;
(ch[!d] = f) -> fa = this;
f -> update();
}
inline void splay()
{
for (; check(); rotate())
if (fa -> check())
{
(type() != fa -> type() ? this : fa) -> rotate();
}
update();
}
inline void access()
{
R Node *i = this, *j = null;
for (; i != null; i = (j = i) -> fa)
{
i -> splay();
// printf("i %d j %d\n", i - null, j - null);
if (i -> ch[] != null)
{
// printf("%d +1\n", i -> ch[1] -> mx - null);
ql = dfn[i -> ch[] -> mx - null]; qr = rig[i -> ch[] -> mx - null]; qv = ;
modify(, , n);
}
if (j != null)
{
// printf("%d -1\n", j - null);
ql = dfn[j -> mx - null]; qr = rig[j -> mx - null]; qv = -;
modify(, , n);
}
i -> ch[] = j;
}
}
} mem[maxn];
int main()
{
// freopen("in.in", "r", stdin);
// freopen("out.out", "w", stdout);
R int m; scanf("%d%d", &n, &m); null = mem;
for (R int i = ; i < n; ++i)
{
R int a, b; scanf("%d%d", &a, &b); link(a, b);
}
dfs1(); dfs2(); build(, , n);
for (R int i = ; i <= n; ++i) mem[i] = (Node) {{mem, mem}, mem + fa[i], mem + i};
for (; m; --m)
{
R int opt, x, y; scanf("%d%d", &opt, &x);
if (opt == ) (mem + x) -> access();
else if (opt == )
{
scanf("%d", &y);
R int lca = getlca(x, y), dx, dy, dlca;
ql = dfn[x]; qr = dfn[x];
dx = query(, , n);
ql = dfn[y]; qr = dfn[y];
dy = query(, , n);
ql = dfn[lca]; qr = dfn[lca];
dlca = query(, , n);
printf("%d\n", dx + dy - dlca * + );
}
else
{
ql = dfn[x]; qr = rig[x];
printf("%d\n", query(, , n));
}
}
return ;
}
D1T2
[Sdoi2017]序列计数
循环矩阵快速幂。
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <bitset>
#include <cstring> #define R register
#define maxn 20000010
const int mod = ;
int pr[maxn / ], prcnt;
std::bitset<maxn> vis;
typedef int Vector[];
Vector num1, num2, base;
int p;
void mul(R Vector A, R Vector B)
{
R Vector C; memset(C, , p << );
for (R int i = ; i < p; ++i) for (R int j = ; j < p; ++j)
C[(i + j) % p] = (C[(i + j) % p] + 1ll * A[i] * B[j]) % mod;
memcpy(A, C, p << );
}
int main()
{
R int n, m; scanf("%d%d%d", &n, &m, &p);
num1[] = ;
for (R int i = ; i <= m; ++i)
{
++num1[i % p];
if (!vis[i]) pr[++prcnt] = i, --num2[i % p];
for (R int j = ; j <= prcnt && i * pr[j] <= m; ++j)
{
vis[i * pr[j]] = ;
if (i % pr[j] == ) break;
}
}
for (R int i = ; i < p; ++i) num2[i] += num1[i];
memcpy(base, num1, p << );
memset(num1, , p << ); num1[] = ;
for (R int power = n; power; power >>= , mul(base, base))
power & ? mul(num1, base), : ;
memcpy(base, num2, p << );
memset(num2, , p << ); num2[] = ;
for (R int power = n; power; power >>= , mul(base, base))
power & ? mul(num2, base), : ;
printf("%d\n", (num1[] - num2[] + mod) % mod);
return ;
}
D1T3
Day2
[Sdoi2017]新生舞会
分数规划->二分+费用流。
#include <cstdio>
#include <cstring>
#include <algorithm> #define maxn 210
#define R register
#define cmin(_a, _b) (_a > (_b) ? _a = (_b) : 0)
typedef double db;
struct Edge {
Edge *next, *rev;
int from, to, cap;
db cost;
} *last[maxn], *prev[maxn], e[maxn * maxn * ], *ecnt = e;
inline void link(R int a, R int b, R int w, R db c)
{
*++ecnt = (Edge) {last[a], ecnt + , a, b, w, c}; last[a] = ecnt;
*++ecnt = (Edge) {last[b], ecnt - , b, a, , -c}; last[b] = ecnt;
}
const db inf = 1e9;
int a[maxn][maxn], b[maxn][maxn], n, q[maxn * ], s, t;
db ans, dis[maxn];
bool inq[maxn];
inline bool spfa()
{
for (R int i = ; i <= t; ++i) dis[i] = inf;
R int head = , tail = ; q[] = s;
while (head < tail)
{
R int now = q[++head]; inq[now] = ;
for (R Edge *iter = last[now]; iter; iter = iter -> next)
if (iter -> cap && dis[iter -> to] > dis[now] + iter -> cost)
{
dis[iter -> to] = dis[now] + iter -> cost;
prev[iter -> to] = iter;
!inq[iter -> to] ? inq[q[++tail] = iter -> to] = : ;
}
}
return dis[t] != inf;
}
inline void mcmf()
{
R int x = 0x7fffffff;
for (R Edge *iter = prev[t]; iter; iter = prev[iter -> from]) cmin(x, iter -> cap);
for (R Edge *iter = prev[t]; iter; iter = prev[iter -> from])
{
iter -> cap -= x;
iter -> rev -> cap += x;
ans += iter -> cost * x;
}
}
inline db val(R db k)
{
memset(last, , (t + ) << ); ecnt = e; ans = ;
for (R int i = ; i <= n; ++i)
{
link(s, i, , ); link(i + n, t, , );
for (R int j = ; j <= n; ++j)
link(i, j + n, , k * b[i][j] - a[i][j]);
}
while (spfa()) mcmf();
return -ans;
}
int main()
{
scanf("%d", &n);
for (R int i = ; i <= n; ++i) for (R int j = ; j <= n; ++j) scanf("%d", &a[i][j]);
for (R int i = ; i <= n; ++i) for (R int j = ; j <= n; ++j) scanf("%d", &b[i][j]);
s = ; t = n << | ;
R db left = , right = 1e4;
while (right - left > 1e-)
{
R db mid = (left + right) * 0.5;
if (val(mid) > ) left = mid;
else right = mid;
}
printf("%.6lf\n", left);
return ;
}
D2T1
[Sdoi2017]硬币游戏
很神的题。一开始只会6方的高斯消元。后来看了题解,计f[i]为i获胜的概率。f[0]表示没人获胜的概率。若我们计S_i表示i获胜的字符串的集合,S_0表示没有人获胜的字符串的集合。显然,这些集合的大小都是正无穷的。但我们只需要知道它们之间的比率。
我们以样例为例。
3 3
THT
HTT
TTH
首先,我们可以确定的是在所有的S_0的后面加上`THT`肯定游戏就结束了。
但问题是赢的不一定是第一个人。
比如,若S_0里最后两位如果是`HT`,那么此时就会在加上第一个`T`时就结束游戏了。同理,最后一位如果是`T`的话,那么加上`TH`以后就结束游戏了。
那么我们可以考虑,在所有的S_0集合后加上`THT`这个后缀,得到的字符串集合可以表示为:{1获胜的集合,2获胜的集合+`HT`,3获胜的集合+`T`}。
(注意:这里的`HT`和`T`均为`THT`的某个后缀)
所以可以得到这样的式子:0.125 * f_0 = f_1 + f_2 * 0.25 + f_3 * 0.5。然后对于每个串都能得到一个这样的式子,再加上所有人获胜的概率和为1,我们就得到了一个n+1个未知数,有n+1个方程的方程组。用高斯消元解决即可。
如何得到上面的系数?我们发现是会有上面的那种情况只有可能是i的某个前缀和j的某个后缀相等。所以可以用KMP把两个串拼起来来找到每个前缀和后缀相等的长度。
#include <cstdio>
#include <cmath>
#include <algorithm> #define R register
#define maxn 310
typedef double db;
char s[maxn][maxn], st[maxn << ];
db a[maxn][maxn], x[maxn], pw[maxn];
int fa[maxn << ], m;
inline db calc(R int a, R int b)
{
for (R int i = ; i <= m; ++i) st[i] = s[a][i]; st[m + ] = '';
for (R int i = ; i <= m; ++i) st[i + m + ] = s[b][i];
fa[] = ;
R int p = ;
// puts(st + 1);
for (R int i = ; i <= m + m + ; ++i)
{
while (p && st[p + ] != st[i]) p = fa[p];
st[p + ] == st[i] ? ++p : ;
fa[i] = p;
// printf("%d\n", fa[i]);
}
R db ans = ;
// printf("%d %d\n", a, b);
while (p)
{
// printf("p = %d\n", p);
ans += pw[m - p];
p = fa[p];
}
// printf("%.2lf\n", ans);
return ans;
}
int main()
{
R int n; scanf("%d%d", &n, &m);
for (R int i = ; i <= n; ++i) scanf("%s", s[i] + );
pw[] = ; for (R int i = ; i <= m; ++i) pw[i] = pw[i - ] * 0.5;
for (R int i = ; i <= n; ++i)
{
a[i][] = -pw[m];
a[][i] = ;
for (R int j = ; j <= n; ++j)
{
// if (i == j) continue;
a[i][j] += calc(i, j);
}
}
a[][n + ] = ; for (R int i = ; i <= n; ++i)
{
if (fabs(a[i][i]) < 1e-)
{
for (R int j = i + ; j <= n; ++j)
if (fabs(a[j][i]) > fabs(a[i][i]))
{
for (R int k = i; k <= n + ; ++k) std::swap(a[i][k], a[j][k]);
break;
}
}
for (R int j = i + ; j <= n; ++j)
{
R db temp = a[j][i] / a[i][i];
for (R int k = i; k <= n + ; ++k)
a[j][k] -= a[i][k] * temp;
}
}
x[n] = a[n][n + ] / a[n][n];
// fprintf(stderr, "%.2lf %.2lf\n", a[n][n], a[n][n + 1]);
for (R int i = n - ; i; --i)
{
R db tmp = a[i][n + ];
for (R int j = i + ; j <= n; ++j)
tmp -= a[i][j] * x[j];
x[i] = tmp / a[i][i];
}
for (R int i = ; i <= n; ++i) printf("%.10lf\n", x[i]);
return ;
}
D2T2
[Sdoi2017]相关分析
把式子强拆开来发现维护区间x_i的和,y_i的和,x_i^2的和,x_i*y_i的和。还需要资磁x,y分别区间加,区间覆盖成一个等差数列(因为公差为1所以比较容易维护)。
这些线段树都可以做,细节比较多吧,调的时候最好还是靠对拍。
#include <cstdio> #define R register
#define maxn 1048576
int xi[maxn], yi[maxn];
typedef long long ll;
typedef double db;
struct data {
db x, y, xy, xx;
inline data operator + (const data &that) const {return (data) {x + that.x, y + that.y, xy + that.xy, xx + that.xx};}
inline data operator += (const data &that) {x += that.x; y += that.y; xy += that.xy; xx += that.xx; }
};
struct Seg {
int tag_set_x, tag_set_y, tag_add_x, tag_add_y;
data x;
} tr[maxn];
ll i2[maxn];
inline void update(R int o)
{
tr[o].x = tr[o << ].x + tr[o << | ].x;
}
void data_add(R data &x, R int s, R int t, R int len)
{
x.xx += * s * x.x + (db) s * s * len;
x.xy += s * x.y + t * x.x + (db) s * t * len;
x.x += (db) s * len;
x.y += (db) t * len;
}
void data_set(R data &x, R int s, R int t, R int l, R int r)
{
R ll si = (db) (l + r) * (r - l + ) / ;
x.x = (db) s * (r - l + ) + si;
x.y = (db) t * (r - l + ) + si;
x.xx = (db) s * s * (r - l + ) + * s * si + i2[r] - i2[l - ];
x.xy = i2[r] - i2[l - ] + (db) s * t * (r - l + ) + si * (s + t);
// printf("%lld %lld %lld %lld\n", x.x, x.y, x.xx, x.xy);
}
void pushdown(R int o, R int l, R int r)
{
R int mid = l + r >> ;
if (tr[o].tag_set_x != - || tr[o].tag_set_y != -)
{
data_set(tr[o << ].x, tr[o].tag_set_x, tr[o].tag_set_y, l, mid);
data_set(tr[o << | ].x, tr[o].tag_set_x, tr[o].tag_set_y, mid + , r); tr[o << ].tag_set_x = tr[o].tag_set_x;
tr[o << ].tag_set_y = tr[o].tag_set_y;
tr[o << | ].tag_set_x = tr[o].tag_set_x;
tr[o << | ].tag_set_y = tr[o].tag_set_y;
tr[o << ].tag_add_x = ;
tr[o << | ].tag_add_x = ;
tr[o << ].tag_add_y = ;
tr[o << | ].tag_add_y = ; tr[o].tag_set_x = tr[o].tag_set_y = -;
}
if (tr[o].tag_add_x || tr[o].tag_add_y)
{
data_add(tr[o << ].x, tr[o].tag_add_x, tr[o].tag_add_y, mid - l + );
data_add(tr[o << | ].x, tr[o].tag_add_x, tr[o].tag_add_y, r - mid); tr[o << ].tag_add_x += tr[o].tag_add_x;
tr[o << ].tag_add_y += tr[o].tag_add_y;
tr[o << | ].tag_add_x += tr[o].tag_add_x;
tr[o << | ].tag_add_y += tr[o].tag_add_y; tr[o].tag_add_x = tr[o].tag_add_y = ;
}
}
void build(R int o, R int l, R int r)
{
tr[o].tag_set_x = tr[o].tag_set_y = -; tr[o].tag_add_x = tr[o].tag_add_y = ;
if (l == r)
{
tr[o].x = (data) {xi[l], yi[l], (db) xi[l] * yi[l], (db) xi[l] * xi[l]};
return ;
}
R int mid = l + r >> ;
build(o << , l, mid); build(o << | , mid + , r);
update(o);
}
data ret; int ql, qr, s, t;
void query(R int o, R int l, R int r)
{
if (ql <= l && r <= qr)
{
ret += tr[o].x; return ;
}
R int mid = l + r >> ;
pushdown(o, l, r);
if (ql <= mid) query(o << , l, mid);
if (mid < qr) query(o << | , mid + , r);
update(o);
}
void modify_add(R int o, R int l, R int r)
{
if (ql <= l && r <= qr)
{
tr[o].tag_add_x += s;
tr[o].tag_add_y += t;
data_add(tr[o].x, s, t, r - l + );
return ;
}
R int mid = l + r >> ;
pushdown(o, l, r);
if (ql <= mid) modify_add(o << , l, mid);
if (mid < qr) modify_add(o << | , mid + , r);
update(o);
}
void modify_set(R int o, R int l, R int r)
{
if (ql <= l && r <= qr)
{
tr[o].tag_set_x = s;
tr[o].tag_set_y = t;
tr[o].tag_add_x = tr[o].tag_add_y = ;
data_set(tr[o].x, s, t, l, r);
return ;
}
R int mid = l + r >> ;
pushdown(o, l, r);
if (ql <= mid) modify_set(o << , l, mid);
if (mid < qr) modify_set(o << | , mid + , r);
update(o);
}
int main()
{
R int n, m; scanf("%d%d", &n, &m);
for (R int i = ; i <= n; ++i) scanf("%d", &xi[i]);
for (R int i = ; i <= n; ++i) scanf("%d", &yi[i]);
for (R int i = ; i <= n; ++i) i2[i] = i2[i - ] + (db) i * i;
build(, , n);
for (; m; --m)
{
R int opt, l, r; scanf("%d%d%d", &opt, &ql, &qr);
if (opt == )
{
ret = (data) {, , , };
query(, , n); l = ql; r = qr;
R db _x = (db) ret.x / (r - l + ), _y = (db) ret.y / (r - l + );
printf("%.10lf\n", (ret.xy - _y * ret.x - _x * ret.y + _x * _y * (r - l + )) / (ret.xx - * _x * ret.x + _x * _x * (r - l + )));
}
else if (opt == )
{
scanf("%d%d", &s, &t);
modify_add(, , n);
}
else
{
scanf("%d%d", &s, &t);
modify_set(, , n);
}
}
return ;
}
D2T3
Sdoi2017试题泛做的更多相关文章
- Shoi2017试题泛做
一口气做完六个省的省选(误) Day1 [Shoi2017]期末考试 枚举最大的天数,然后代价贪心地O(1)计算. #include <cstdio> #include <algor ...
- SDOI2017 R2泛做
由于各种原因,在bzoj上我day1的题一题都没过,所以这里就直接贴loj的链接好了. D1T1 龙与地下城 中心极限定理. https://en.wikipedia.org/wiki/Central ...
- 「美团 CodeM 初赛 Round A」试题泛做
最长树链 树形DP.我们发现gcd是多少其实并不重要,只要不是1就好了,此外只要有一个公共的质数就好了.计f[i][j]表示i子树内含有j因子的最长链是多少.因为一个数的不同的质因子个数是log级别的 ...
- Hnoi2017试题泛做
Day1 4825: [Hnoi2017]单旋 注意到二叉查找树的一个性质:其中序遍历就是所有元素按权值排序的顺序. 所以我们可以离线地把这棵树的中序遍历求出来.然后我们在插入的时候就可以用一个set ...
- Cqoi2017试题泛做
Day1 4813: [Cqoi2017]小Q的棋盘 树形背包DP. #include <cstdio> #define maxn 110 #define R register #defi ...
- 「美团 CodeM 资格赛」试题泛做
LibreOJ真是吼啊! 数码 推个式子,把枚举因数转为枚举倍数.然后就发现它是根号分段的.然后每一段算一下就好了. #include <cstdio> #include <cstr ...
- codeforces泛做..
前面说点什么.. 为了完成日常积累,傻逼呵呵的我决定来一发codeforces 挑水题 泛做.. 嗯对,就是泛做.. 主要就是把codeforces Div.1的ABCD都尝试一下吧0.0.. 挖坑0 ...
- 学记笔记 $\times$ 巩固 · 期望泛做$Junior$
最近泛做了期望的相关题目,大概\(Luogu\)上提供的比较简单的题都做了吧\(233\) 好吧其实是好几天之前做的了,不过因为太颓废一直没有整理-- \(Task1\) 期望的定义 在概率论和统计学 ...
- 「PKUWC2018/PKUSC2018」试题选做
「PKUWC2018/PKUSC2018」试题选做 最近还没想好报THUSC还是PKUSC,THU发我的三类约(再来一瓶)不知道要不要用,甚至不知道营还办不办,协议还有没有用.所以这些事情就暂时先不管 ...
随机推荐
- qt 两种按钮点击事件应用
1.传统connect 例如: connect(ui->findPushBtn,SIGNAL(clicked()),this,SLOT(find())); 参数1:事件UI 参数2:点击系统函数 ...
- for循环练习题:拆解字符并输入下标
test = input('请输入:') for item in range(0,len(test)): print(item,test[item])
- 插座-网络问题-ESP8266
//ATK-ESP8266模块测试主函数,检查WIFI模块是否在线 void atk_8266_test(void) { ))//检查WIFI模块是否在线 { atk_8266_quit_trans( ...
- 记一次程序从x86_64linux平台移植到armv7平台
前言 最近接了个任务,需要把代码移植到armv7平台,搜寻相关方法,了解到可以利用交叉编译工具如:gcc-linaro-arm-linux-gnueabihf.把自己依赖的第三方库代码和自己代码分别编 ...
- cannot convert from pointer to base class 'QObject' to pointer to derived class 'subClass' via virtual base 'baseClass'
QT 编译不过的另一个问题: 1. 新建一个console工程 QT -= gui CONFIG += c++ console CONFIG -= app_bundle # The following ...
- 剑指offer 数字翻译成字符串
0 -> 'a', 1->'b', ..., 11 -> 'l', ..., 25->'z'. 计算一个数有多少种不同的翻译方法. 分析:记f[i]表示从第i位起的不同翻译数目 ...
- luogu P2093 [国家集训队]JZPFAR
传送门 要维护平面上点的信息,所以可以用KD-tree来维护,然后维护一个大小为\(k\)的堆,每次从根开始遍历,遇到一个点就看能不能作为前\(k\)远的点,也就是看能不能把堆中最近的点给替换掉.如果 ...
- MySQL数据库主从同步实战过程
Linux系统MySQL数据库主从同步实战过程 安装环境说明 系统环境: [root@~]# cat /etc/redhat-release CentOS release 6.5 (Final) ...
- 在springmvc中使用requestContextListener获取全部的request对象
RequestContextListener实现了 ServletRequestListener ,在其覆盖的requestInitialized(ServletRequestEvent reques ...
- 优雅的swiper实例
swiper实例 <!DOCTYPE html> <html lang="en"> <head> <meta name="vie ...