- 博客(5)
- 收藏
- 关注
原创 CodeForces 1045 简要题解
Last chance线段树优化连边,输出方案先输出容量为 222 的。#include <bits/stdc++.h>using namespace std;const int inf = 0x3f3f3f3f;namespace flow {struct edge_t { int to, cap, rev; edge_t(int t, int c, in...
2018-09-25 20:06:59 848
原创 Japan Alumni Group Summer Camp 2018 Day 2 简要题解
10^N+7模拟。#include <bits/stdc++.h>using namespace std;int main() {#ifdef wxh010910 freopen("input.txt", "r", stdin);#endif int x, y, z; scanf("%d %d %d", &x, &y, &z); ...
2018-09-18 16:21:10 1675
原创 Atcoder Grand Contest 027 简要题解
Candy Distribution Again模拟。#include <bits/stdc++.h>using namespace std;int main() {#ifdef wxh010910 freopen("input.txt", "r", stdin);#endif int n, m; scanf("%d %d", &n, &m)...
2018-09-17 20:35:03 589
原创 CodeForces 1023G. Pisces
链接:link题意:有一棵 nnn 个点的树,有边权,进行了 kkk 次观察,每次观察是在第 didid_i 天在 pipip_i 点至少有 fifif_i 条鱼,鱼每天可以走一个单位,问最少有多少条鱼。题解:考虑 Dilworth 定理,求最长反链就行了。一个结论是,考虑子树 xxx 中的一个集合形成反链当且仅当:每个子树内部是反链。存在一个时刻 ttt ...
2018-09-11 10:07:41 1025
原创 CodeForces 1039E. Summer Oenothera Exhibition
链接:link题意:给一个长度为 nnn 的序列,qqq 次询问,每次给一个 kikik_i ,问最少将序列划分成多少段,满足每一段的极差不超过 w−kiw−kiw - k_i 。题解:这个问题是可以贪心的,所以可以对于一个起始位置,可以暴力或者倍增找它的下一个位置 nextinextinext_i 。为了方便我们将询问离线,按照 w−kiw−kiw - k_i 递增的...
2018-09-11 09:54:52 742
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人