xht37's blog

xht37's blog

  • 关于我
  • 记录
  • 笔记
  • 游记
  • 题解

AtCoder Grand Contest 023 题解

07月18日 题解 没有评论 前缀和/差分,博弈论,并查集,树状数组,组合计数,贪心

AtCoder Grand Contest 023 Zero-Sum Ranges 前缀和一下直接计数即可。 const int N = 2e5 + 7; int n, a[N]; ll s, ans; int main() { rd(n), rda(a, n); map<ll, int> c; for (int i...

AtCoder Grand Contest 024 题解

07月17日 题解 没有评论 DP,构造,状压,组合计数,贪心

AtCoder Grand Contest 024 Fairness 每一轮会从 $(a,b,c)$ 变成 $(b+c,a+c,a+c)$,第 $1,2$ 个数之差取反。 所以如果 $k$ 为奇数答案为 $b-a$,否则为 $a-b$。 int main() { int a, b, c; ll k;...

AtCoder Grand Contest 025 题解

07月16日 题解 没有评论 二分图,构造,组合计数,贪心

AtCoder Grand Contest 025 Digits Sum 枚举。 inline int calc(int x) { int s = 0; while (x) s += x % 10, x /= 10; return s; } int main() { int n, ans = 1e9; rd(n); for...

AtCoder Grand Contest 026 题解

07月14日 题解 没有评论 DP,二分,区间 DP,博弈论,数论,状压,笛卡尔树,组合计数,贪心

AtCoder Grand Contest 026 Colorful Slimes 2 对于每个同色连续段,设长度为 $c$,则对答案有贡献 $\lfloor \frac c2 \rfloor$。 const int N = 107; int n, a[N], ans; int main() { rd(n), rda(a,...

AtCoder Grand Contest 027 题解

07月12日 题解 没有评论 DP,数论,构造,组合计数,调和级数,贪心

AtCoder Grand Contest 027 Candy Distribution Again 排序后从小到大贪心的选。 const int N = 107; int n, x, a[N], s; int main() { rd(n, x), rda(a, n); sort(a + 1, a + n + 1); for (...

AtCoder Grand Contest 028 题解

07月11日 题解 没有评论 DP,前缀和/差分,区间 DP,数论,线段树,组合计数,记忆化搜索,贪心

AtCoder Grand Contest 028 Two Abbreviations 答案显然要么为 $-1$ 要么为 $\text{lcm}(n,m)$,判一下就好了。 const int N = 1e5 + 7; int n, m, d; char a[N], b[N]; int main() { rd(n, m), d = ...

AtCoder Grand Contest 029 题解

07月10日 题解 没有评论 DP,二分,二分图,博弈论,构造,树形 DP,网络流,贪心

AtCoder Grand Contest 029 Irreversible operation 最后的字符串一定是所有 W 在 B 前面,于是考虑对应位置下标差之和即可。 const int N = 2e5 + 7; int n, p[N], t; char s[N]; ll ans; int main() { ...

AtCoder Grand Contest 030 题解

07月09日 题解 没有评论 DP,前缀和/差分,构造,概率期望,组合计数,贪心

AtCoder Grand Contest 030 Poisonous Cookies $ans = \min(a+b+1,c) + b$。 int main() { ll a, b, c; rd(a, b, c); print(min(a + b + 1, c) + b); return 0; } Tree Burning 贪心,...

AtCoder Grand Contest 031 题解

07月08日 题解 没有评论 DP,并查集,数论,构造,组合计数,网络流,群论,费用流

AtCoder Grand Contest 031 Colorful Subsequence 对于每种字符,可以选某一个或者不选,最后去掉空的。 const int N = 1e5 + 7; int n; char s[N]; int main() { rd(n), rds(s, n); map<char...

AtCoder Grand Contest 032 题解

07月06日 题解 没有评论 DP,二分,构造,概率期望,欧拉回路,组合计数,贪心

AtCoder Grand Contest 032 Limited Insertion 倒着考虑,每次找到最大的 $i$ 满足 $a_i = i$ 然后删掉,如果不存在则无解。 const int N = 107; int n, a[N], ans[N]; int main() { rd(n), rda(a, n...

  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 6
  • 7

文章分类

  • 游记 (9)
  • 记录 (6)
  • 笔记 (29)
  • 题解 (168)

热门文章

随机推荐

  • CF566C Logistical Questions 题解
  • CF704D Captain America 题解
  • CF538G Berserk Robot 题解
  • 动态 DP 学习笔记
  • ARC096F Sweet Alchemy 题解
  • ARC101E Ribbons on Tree 题解
  • Codeforces Round #638 (Div. 2) 题解
  • ARC101F Robots and Exits 题解
  • AtCoder Grand Contest 034 题解
  • CF587F Duff is Mad 题解

标签云

AC 自动机 bitset DP Hash Trie Two Pointers 二分 二分图 交互题 凸包 前缀和/差分 区间 DP 单调栈 单调队列 博弈论 可持久化 基环树 容斥 并查集 扫描线 换根 DP 数论 曼哈顿距离 最小生成树 最短路 构造 树形 DP 树状数组 树链剖分 根号分治 概率期望 欧拉回路 状压 生成函数 矩阵 线段树 组合计数 网络流 背包 计算几何 记忆化搜索 调和级数 贪心 费用流 随机化

友情链接

  • PinkRabbit
  • RiverFun
  • M_sea
  • xzz
  • Itst
  • Owen_codeisking
  • yyb
  • Siyuan
  • EternalAlexander
  • lk
  • LJC00118
  • memset0
  • StudyingFather
  • wjyyy
  • Dew
  • zgjjj
  • ouuan
  • KS
  • EI
  • Winniechen
  • ViXbob
  • chhokmah
  • zsy
  • dysyn1314
  • icy

Powered by WordPress. Theme by JieStyle Two |