04 2021 档案

摘要:[Atcoder 题面传送门](https://atcoder.jp/contests/agc031/tasks/arc031_d) & [洛谷题面传送门](https://www.luogu.com.cn/problem/AT4694) 猜结论神题。 首先考虑探究题目中 f 函数的性质,$f( 阅读全文
posted @ 2021-04-29 16:00 tzc_wk 阅读(57) 评论(1) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/1326/problem/F2) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF1326F2) 首先暴力 3nn 枚举子集显然是过不去的,否则这题 阅读全文
posted @ 2021-04-29 11:25 tzc_wk 阅读(62) 评论(0) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P4887) 首先看到这类数数对的问题可以考虑莫队,记 S 为二进制下有 k1 的数集,我们实时维护一个桶 cnti 表示当前区间中值为 i 的数有多少个,那么加入一个数 v 的时候,答 阅读全文
posted @ 2021-04-29 08:20 tzc_wk 阅读(74) 评论(0) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/1513/problem/F) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF1513F) 首先我看到这题的第一反应是分类讨论+数据结构,即枚举其中一个 阅读全文
posted @ 2021-04-28 23:18 tzc_wk 阅读(62) 评论(0) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P3307) 看到题目我们显然可以将题目拆分成两部分:首先求出有多少个符合要求的珠子 c,这样我们就可以将每种珠子看成一种颜色,题目也就等价于有多少种用 c 种颜色染长度为 n 的环的方法,满足相邻格子颜色 阅读全文
posted @ 2021-04-24 14:54 tzc_wk 阅读(97) 评论(0) 推荐(0) 编辑
摘要:### A 这题我竟然 WA 了两发,丢人( 直接贪心,对于 i=1,2,,n1,每次拿 in 执行操作,直到 ai=0 或用完所有操作次数为止 ### B 这题我竟然 WA 了一发,丢人( 题目等价于是否可以将原数组划分为 2 段满足每段异或和相同 阅读全文
posted @ 2021-04-22 19:50 tzc_wk 阅读(114) 评论(0) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/585/problem/E) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF585E) 首先我们注意到对于固定的 x 及集合 S,如果 $\gc 阅读全文
posted @ 2021-04-21 19:36 tzc_wk 阅读(65) 评论(1) 推荐(0) 编辑
摘要:[Atcoder 题面传送门](https://atcoder.jp/contests/arc117/tasks/arc117_d) 我们考虑探究一下怎么最小化 maxi=1nEi,我们假设 $E_{p_1}dep1[rt1]) rt1=i; dfs2(rt1,0);f 阅读全文
posted @ 2021-04-20 01:59 tzc_wk 阅读(98) 评论(0) 推荐(1) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/453/problem/E) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF453E) 首先注意到对于每个小马,在任意时刻它的法力值只有三种可能: - 阅读全文
posted @ 2021-04-19 20:03 tzc_wk 阅读(67) 评论(0) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P5331) 首先熟悉网络流的同学应该能一眼看出此题的建模方法: - 将每个点拆成两个点 ini,outi,连一条 Sini,容量为 1 费用为 0 的边 - 连一条 $in_i\to T 阅读全文
posted @ 2021-04-18 16:48 tzc_wk 阅读(119) 评论(1) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/1299/problem/D) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF1299D) 一道线性基的综合题 首先注意到“非简单路径”“异或和”等字眼 阅读全文
posted @ 2021-04-18 16:16 tzc_wk 阅读(84) 评论(0) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P3270) 考虑容斥。我们记 ai 为钦定 i 个人被 B 神碾压的方案数,如果我们已经求出了 ai 那么一遍二项式反演即可求出答案,即 $ans=\sum\limits_{i=k}^{n-1}a_i 阅读全文
posted @ 2021-04-18 12:33 tzc_wk 阅读(94) 评论(0) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/1119/problem/H) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF1119H) FWT 的 immortal tea %%% 首先我们可以写 阅读全文
posted @ 2021-04-17 22:47 tzc_wk 阅读(105) 评论(0) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/611/problem/H) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF611H) 首先我们将所有十进制下位数相同的点看作一种颜色,这样题目转化为, 阅读全文
posted @ 2021-04-17 13:07 tzc_wk 阅读(54) 评论(1) 推荐(0) 编辑
摘要:~~u1s1 距离省选只剩 5 days 了,现在学新算法真的合适吗((~~ ### 位运算卷积 众所周知,对于最普通的卷积 ci=j+k=iajbkajbk 的贡献累加到 cj+k 上,因此这种卷积又被称为加法卷积。 但是对于某些卷积,$a 阅读全文
posted @ 2021-04-17 11:00 tzc_wk 阅读(166) 评论(1) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P5249) ~~期望真 nm 有意思,所以蒟蒻又来颓期望辣~~ 先特判掉 P0=0 的情况,下面假设 P00。 首先注意到我们每次将加特林对准一个人,如果这个人被毙掉了,那么相当于进入了 $n-1 阅读全文
posted @ 2021-04-17 10:46 tzc_wk 阅读(115) 评论(0) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/521/problem/D) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF521D) 一道不算太难的贪心,可惜又没自己想出来,~~显然省选之后我的能力 阅读全文
posted @ 2021-04-15 23:15 tzc_wk 阅读(85) 评论(1) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/516/problem/D) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF516D) 这是一道 jxd 的作业题,感觉难度不是特别大(虽然我并没有自己 阅读全文
posted @ 2021-04-14 23:19 tzc_wk 阅读(52) 评论(0) 推荐(0) 编辑
摘要:[Atcoder 题面传送门](https://atcoder.jp/contests/agc038/tasks/agc038_e) & [洛谷题面传送门](https://www.luogu.com.cn/problem/AT5202) 我竟然能独立做出 Ag 的 AGC E,incredible 阅读全文
posted @ 2021-04-13 23:16 tzc_wk 阅读(122) 评论(0) 推荐(0) 编辑
摘要:RT,存张图备忘 ![](https://cdn.luogu.com.cn/upload/image_hosting/3xosziov.png) 阅读全文
posted @ 2021-04-13 21:52 tzc_wk 阅读(310) 评论(1) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P5643) 一道挺综合的 hot tea,放到 PKUWC 的 D2T2 还挺喜闻乐见的( 首先我们考虑怎样对一个固定的集合 S 计算答案,注意到我们要求的是一个形如 E(max(S)) 的式子,套用 Mi 阅读全文
posted @ 2021-04-13 18:02 tzc_wk 阅读(52) 评论(0) 推荐(0) 编辑
摘要:大家好,今天我们来聊聊~~淀粉质~~点分治。~~又开了个有点大的坑(~~ 点分治是一种针对树上路径问题的强有力的算法。一般看到与树上任意两点之间的路径有关的问题,那这题八成就是点分治了。那么点分治究竟是个什么玩意儿呢?我们不妨先来看道例题:[P3806 【模板】点分治1](https://www.l 阅读全文
posted @ 2021-04-12 22:55 tzc_wk 阅读(235) 评论(2) 推荐(4) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P4707) 首先看到这种求形如 E(max(T)) 的期望题,可以套路地想到 Min-Max 容斥 max(S)=TS(1)|T|1min(T) 阅读全文
posted @ 2021-04-12 22:41 tzc_wk 阅读(57) 评论(0) 推荐(0) 编辑
摘要:[vjudge 题面传送门](https://vjudge.net/problem/51Nod-1355) 首先我们知道斐波那契数列的 lcm 是不太容易计算的,但是它们的 gcd 非常容易计算——gcd(fx,fy)=fgcd(x,y),该性质已在我的[这篇博客](https:/ 阅读全文
posted @ 2021-04-10 22:47 tzc_wk 阅读(103) 评论(0) 推荐(0) 编辑
摘要:## Day -24 - 2021.3.16 终于停课了(bushi)…… 稍微规划了下省选前听课的日程,大约周二(3.16)请一天,周四(3.18)请一天,周五(3.19)请半天?月考正常考,月考完请两周? 不管怎样 JSOI 2021 冲一把吧。 ## Day -15 - 2021.3.25 月 阅读全文
posted @ 2021-04-09 22:48 tzc_wk 阅读(1524) 评论(8) 推荐(3) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/571/problem/E) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF571E) u1s1 感觉此题思维难度不太大,不过大概是细节多得到了精神污染 阅读全文
posted @ 2021-04-08 23:09 tzc_wk 阅读(73) 评论(0) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/582/problem/D) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF582D) 一道数论与数位 dp 结合的神题 %%% 首先在做这道题之前你需 阅读全文
posted @ 2021-04-08 20:37 tzc_wk 阅读(62) 评论(0) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P6860) 首先我们来探究一下什么样的 (a,b) 满足 p(a,b)=1。不难发现只要点 (1,0) 能够到达,那么网格上所有点都能到达,因为由于 (1,0) 能够到达,将坐标轴旋转一下 $(0,1 阅读全文
posted @ 2021-04-08 19:33 tzc_wk 阅读(66) 评论(0) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/809/problem/E) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF809E) ~~1A,就 nm 爽(~~ 首先此题一个很棘手的地方在于贡献的 阅读全文
posted @ 2021-04-07 20:06 tzc_wk 阅读(63) 评论(0) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P5299) hot tea 啊……这种风格及难度的题放在省选 D2T1 左右还是挺喜闻乐见的罢 首先考虑对于固定的 m 张牌怎样求出最优的打牌策略,假设我们抽到了 p 张强化牌,攻击力从大到小分别为 $x_1 阅读全文
posted @ 2021-04-07 17:05 tzc_wk 阅读(52) 评论(0) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/1188/problem/D) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF1188D) 首先我们考虑枚举最后这 n 个数变成的值 v,那么需 阅读全文
posted @ 2021-04-07 15:19 tzc_wk 阅读(59) 评论(1) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P4002) 神题。 考虑将所有连通块缩成一个点,那么所有连好边的生成树在缩点之后一定是一个 n 个点的生成树。我们记 di 为第 i 个连通块缩完点之后的度数 1,那么共有 $\prod\limi 阅读全文
posted @ 2021-04-07 12:57 tzc_wk 阅读(109) 评论(0) 推荐(0) 编辑
摘要:[Atcoder 题面传送门](https://atcoder.jp/contests/m-solutions2019/tasks/m_solutions2019_c) & [洛谷题面传送门](https://www.luogu.com.cn/problem/AT5011) 无穷级数求和的简单题,稍 阅读全文
posted @ 2021-04-06 20:18 tzc_wk 阅读(65) 评论(0) 推荐(0) 编辑
摘要:[题面传送门](https://uoj.ac/problem/422) 本来说要找道轮廓线 dp 的题目刷刷来着的?然后就找到了这道题。 然鹅这个题给我最大的启发反而不在轮廓线 dp,而在于让我新学会了一个玩意儿叫做 Min-Max 容斥。 Min-Max 容斥大概讲的就是这样一件事情:对于 阅读全文
posted @ 2021-04-06 18:12 tzc_wk 阅读(62) 评论(1) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/497/problem/E) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF497E) 一道还算不错的矩乘 tea 罢,不过做过类似的题应该就比较套路了 阅读全文
posted @ 2021-04-06 09:40 tzc_wk 阅读(58) 评论(0) 推荐(0) 编辑
摘要:[题面传送门](https://loj.ac/p/2372) u1s1 似乎这题全网无一题解?那就由我来写篇题解造福人类罢(伦敦雾 首先看这数据范围,一脸状压。考虑到每一层的状态与上面两层有关,因此每层转移到下一层的有用信息只有两层,需要用三进制保存状态。不过如果我们按照套路对行的状态进行压缩,我们 阅读全文
posted @ 2021-04-05 20:17 tzc_wk 阅读(63) 评论(0) 推荐(1) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/848/problem/E) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF848E) 神仙 D1E,一道货真价实的 *3400 %%%%%%%%%%% 阅读全文
posted @ 2021-04-04 14:44 tzc_wk 阅读(69) 评论(0) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P6030) 之所以写个题解是因为题解区大部分题解的做法都有 bug(u1s1 周六上午在讨论区里连发两个 hack 的是我,由于我被禁言才让 ycx 代发的) 首先碰到这种期望题,我们套路地设 dpu 为从节点 阅读全文
posted @ 2021-04-04 01:30 tzc_wk 阅读(94) 评论(0) 推荐(0) 编辑
摘要:[Atcoder 题面传送门](https://atcoder.jp/contests/arc093/tasks/arc093_d) & [洛谷题面传送门](https://www.luogu.com.cn/problem/AT3981) 常规题,简单写写罢((( 首先 1 的位置是什么不重要, 阅读全文
posted @ 2021-04-03 23:57 tzc_wk 阅读(46) 评论(0) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/1500/problem/E) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF1500E) 一道线段树的套路题(似乎 ycx 会做这道题?orzorz! 阅读全文
posted @ 2021-04-03 16:46 tzc_wk 阅读(63) 评论(0) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P4463) & [加强版题面传送门](https://www.luogu.com.cn/problem/P5850) 竟然能独立做出 jxd 互测的题(及其加强版),震撼震撼(((故写题解以祭之 首先由于 $a_1, 阅读全文
posted @ 2021-04-03 00:51 tzc_wk 阅读(99) 评论(0) 推荐(0) 编辑
摘要:u1s1 这是我第三次学这个东西了,第一次大约是去年三月,第二次大约是去年暑假,事实证明那时候并没有把这东西真正学进去因为我那时并没有真正理解线性基的本质,现在学完高斯消元,学完线性代数的一些基本芝士再回来看这东西就感觉异常友好了( ### 一些有关线性代数的前置芝士 #### 向量 一个 n 阅读全文
posted @ 2021-04-01 20:25 tzc_wk 阅读(288) 评论(0) 推荐(0) 编辑
摘要:[题面传送门](https://www.luogu.com.cn/problem/P7451) 看到乘积为平方数我们可以很自然地想到[这道题](https://www.luogu.com.cn/problem/CF895C),具体来说,我们对 1107 中所有质因子标号 $1,2,\ 阅读全文
posted @ 2021-04-01 20:21 tzc_wk 阅读(120) 评论(0) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/724/problem/G) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF724G) 一道还算不套路的线性基罢…… 首先由于图不连通,并且不同连通块之 阅读全文
posted @ 2021-04-01 19:30 tzc_wk 阅读(78) 评论(0) 推荐(0) 编辑
摘要:[Codeforces 题目传送门](https://codeforces.com/contest/1383/problem/F) & [洛谷题目传送门](https://www.luogu.com.cn/problem/CF1383F) 首先暴力显然是不行的,~~如果你暴力最大流过了我请你吃糖~~ 阅读全文
posted @ 2021-04-01 14:48 tzc_wk 阅读(78) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示