Solution
kaggle Open Problems – Single-Cell Perturbations 1st & 2nd place solution summary
Leaderboard: https://www.kaggle.com/competitions/open-problems-single-cell-perturbations/leaderboard 2nd Solution: https://www.kaggle.com/competitions ......
Solution Set #4
最近写了不少 AGC,感觉高一的时候做挺合适的,不过高一出于对 ad-hoc 和外星人题的恐惧一直没怎么写。其实古早题还是有不少能做的,希望学弟不要像我一样。 36 2nd ucup Stage 13 Shenyang F Ursa Minor 首先显然用区间内的操作可以组成它们的 gcd 对应的操 ......
Solution Set 2023.12.14
CF698F Coprime Permutation 考虑 \(p_i = 0\) 的情况下怎么做,首先排列 \(p_i = i\) 一定符合条件,考虑在此基础上生成其他符合要求的排列,考虑什么情况下 \(p_i\) 和 \(p_j\) 可以互换,发现其可以互换当且仅当对于所有 \(x \neq i ......
Solution Set 2023.12.13
CF1736E Swap and Take 设在第 \(i\) 次操作后产生贡献的值为初始序列的 \(a_{p_i}\),可以发现产生的贡献的指针移动方式为每次向后移动 \(1\),而通过交换数字最多可以使得某个数字每次向后移动 \(1\),由此可以得出每次产生贡献的位置单调不减,即 \(p_1 \ ......
Solution Set 2023.12.12
ABC332G Not Too Many Balls 可以转化为最大流模型,设节点 \(x_i\) 代表第 \(i\) 种球,\(y_j\) 代表第 \(j\) 个盒子。考虑如下建边方案: \(S \rightarrow x_i\),容量为 \(A_i\) \(x_i \rightarrow y_j ......
Solution Set #3
紧急更新。 上 OI-transit 上加训构造,感觉 OI-transit 是很好的找题网站。 25 loj6736. 「2020 集训队论文」最小连通块 应该加个部分分:DFS 序是 \(1\sim n\)。 你考虑这个部分分怎么做。一种做法是剥叶子,每次找到一个叶子的父亲。存在判断一个点是否是 ......
The kexec-based Crash Dumping Solution (翻译 by chatgpt)
原文:https://www.kernel.org/doc/html/latest/admin-guide/kdump/kdump.html 这份文档包括概述、设置、安装和分析信息。 概述 Kdump 使用 kexec 快速引导到一个转储捕获内核,每当需要对系统内核的内存进行转储(例如系统发生崩溃) ......
Solution Set 2023.12.7
方格取数问题 / 王者之剑 可以发现,相互限制的格子的横纵坐标之和肯定是一个奇数和一个偶数。即横纵坐标之和奇偶性相同的格子之间一定不会限制。因此若我们将限制关系以边的形式表达,那么形成的图为一个二分图。 考虑令横纵坐标之和为奇数的格子为左部点,偶数的为右部点;分别对应 \(S, T\) 集合。令左部 ......
Solution Set #2
本来是周末更,但是去了 CTT,源码在学校电脑里,于是鸽了两天。 9 AGC062D Walk Around Neighborhood 不会判无解,什么水平。 把 \(D_i\) 排序,容易发现如果 \(D_n>\sum_{i<n}D_i\) 的话那么一定无解。否则,前面的数能走到的所有点到原点的曼 ......
Solution Set 2023.12.5
[AHOI2009] 最小割 首先考虑如何处理可行边,对于边 \(\left(u, v\right)\),其为可行边与同时满足下列两个条件互为充要条件: \(c_f(u, v) = 0\) 在 \(G_f\) 中不存在路径 \(u \rightarrow v\) 首先可以发现若存在 \(G_f\) ......
Solution Set 2023.12.4
来衡实了,感觉良好。 [NOIP2023] 三值逻辑 一直以为是写假了,结果是写挂了,没有判自环的同时 \(u, v\) 输入反了。 考虑对于每个变量的每个版本均开一个节点,那么赋值关系可以用有向边表示,可以发现最终得到的一定是若干外向基环树和若干外向树组成的图。且被 \(\tt{T,F,U}\) ......
Chinese Solution to Plastic Pollution in Philippines
Plastic Pollution in the Philippines A growing middle class, increased consumer demand and a strong economic boom have spurred the Philippines’ econom ......
Solution Set
\(\text{「ABC222H」Beautiful Binary Tree}\) \(\text{Link}\) \(\text{Describe}\) 对于一个正整数 \(n\),我们称满足以下条件的有根二叉树是一棵美丽的 \(n\) 阶二叉树。 每个节点有一个数字 \(0\) 或 \(1\), ......
Solution Set #1
最后一年了,以后的做题记录大概会是这样的 Solution Set 形式,大概每周末会更一次。也许能起到防止开摆的作用。 做题速度过慢导致的做题广度不够,对难题的恐惧导致的训练强度过低……从未被提醒过,自己栽了跟头才意识到问题。 这周文化课,晚上的时间拿来做了下 AGC,但是怎么前面的题都不会做/f ......
The 'China Solution' in Nigeria
Nigeria, The northern region of Nigeria, particularly the Sahel region, is experiencing severe desertification due to factors such as deforestation, o ......
Solution - Partition Game
Link. 做 vjudge 的题有一种美丽的窒息的感觉。 设 \(f_{i, j}\) 表示前 \(i\) 个选 \(j\) 段出来的最小代价,转移 \(f_{i, j} = \min_{0 \leq k < i} \{f_{k, j - 1} + w_{k + 1, i} \}\),\(w_{k ......
Solution - 公路旅行
Link。 又名:《不会 T1 记》。 原来用到了神秘的倍增!但是我写了一个申必二分,最坏 \(O(qn \log n)\),甚至不如暴力,我是🤡。 类似于 ST 表那样,\(f_{i, j}\) 表示从 \(i\) 出发经过 \(2 ^ j\) 段不大于 \(L\) 的路程,那么 \(f_{i, ......
Solution Set - CF787
Vive le R & M! 还被种草了 Hurt,真的颇有感触,但这是 Solution Set,就不写了。 A. The Monster exgcd,但是发现 \(1 \leq a, b, c, d \leq 100\) 直接暴力枚举即可。我认为这是 \(O(1)\) 的,但题解认为是 \(O( ......
Solution - Hossam and (sub-)palindromic tree
又名:《最近 vjudge 题全部罚坐》。 唯一 Trick:回文序列,就想区间 dp!时间复杂度 \(O(n ^ 2)\)! 如果是序列:\(f_{l, r}\) 表示 \([l, r]\) 的最长回文子序列,\(f_{l, r} = \max(f_{l + 1, r}, f_{l, r - 1} ......
「模拟赛」Solution Set
\(\text{heart}\) \(\text{Solution}\) 可以记 \(f(u)\) 为从 \(u\) 出发到某个点停止的方案数,\(f(u)\) 可以 \(O(n)\) 转移,显然复杂度为 \(O(n^2)\). 当前我们要转移 \(u\) 子树内,对于 \(v\in \text{s ......
Solution - Makoto and a Blackboard
Link。 朴素 dp 应该不用说了。放个用 map 的代码。 int dfs(int n, int k) { if (!k) return n; if (f[make_pair(n, k)]) return f[make_pair(n, k)]; int tot = 0, ans = 0; for ......
公告 & Solution - 公路旅行
以后应该会用 Obsidian 搭个博客,博客园可能会被弃用了。 为了有点价值放个不知道什么东西上来。 Link。 不会 T1!原来用到了神秘的倍增!但是我写了一个申必二分,最坏 \(O(qn \log n)\),甚至不如暴力,我是🤡。 类似于 ST 表那样,\(f_{i, j}\) 表示从 \( ......
solution-CF1615F
LEGOndary Grandmaster https://www.luogu.com.cn/problem/CF1615F 神题!看到题解一眼就知道自己大概率想不出来了。 主要还是积累两个套路: Trick 1 考虑将原序列的奇数位位置上的数取反,惊讶地发现操作简化为了每次交换相邻两个数。显然地, ......
[Luogu NOIP 2023 模拟] Solution
这篇 blog 在我的博客后台躺了好几天了,只不过今天才记起来发。 种树 (plant) 首先看到因数个数,想到在质因数分解后的序列上考虑问题。进一步观察,每个不同质因子的贡献是独立的。 也就是说,我们单独考虑某一个质因子对答案的贡献,是这样的问题: 给长度为 \(n\) 的序列 \(a\) 和一个 ......
The solution of soil erosion
Solution of soil erosion (1) Engineering measures: building terraces, damming and silting land, using earthwork and concrete works, fish scale pits, e ......
A solution to land sailnization
Biologically improved saline-alkali land is barren and soil fertility is poor. Therefore, in the process of transformation, it is an important measure ......
A solution to desertification
What is desertification? Desertification, the process by which natural or human causes reduce the biological productivity of drylands (arid and semiar ......
A solution to soil erosion
A specific measure to cope with soil erosion is to increase vegetation cover in China. How it works and its impact : Firstly, vegetation is the first ......
A solution to soil erosion
A special measure to cope with soil erosion is to increase vegetation cover in China. Vegetation is the first barrier to protect land from outside. Ta ......
Bioremediation Technology—— A Solution to Soil Pollution
Bioremediation Technology for Soil Polution 1. What is bioremediation technology? Bioremediation is a natural process based remediation technology for ......