SkyWT

SkyWT

我们的征途是星辰大海

🚧 本站已迁移到 skywt.cn/blog。所有链接都已重定向。
✨ 如果想体验这个 Typecho 博客主题,可访问 beta.skywt.cn

树链剖分,可以把一棵树划分成多条链,对于每条链可以用线段树等数据结构进行维护,将树形结构的问题转化。

常见的方法是轻重链剖分,即 Heavy-Light Decomposition。

More...


今天发现 vscode 工作区目录下有一个 .vscode 隐藏目录,里面有大量的 ipch 文件,而且占用存储空间都很大。我的工作区一共代码占了不足 300MB,但是那个文件夹占了足足 2.2GB!

点进去可以发现,似乎都是针对某个代码生成的。比如写了个很长的代码,它就给我生成了 170+MB 的 ipch……

More...


这是我的博客发布的第 100 篇文章!🎉

D - Open Communication

Description

有两个玩家,给出分别 n 和 m 个数对,$1\leq n,m\leq 12$,所有数字都 $\in [0,9]$,并且一个数对里的数字不相同,不会有重复的数对。现在有一个“共享数字”,这个数字在 A 玩家的数对里和 B 玩家的数对里都至少出现一次。如果你可以推断出这个数字,输出这个数字;如果你无法推断出这个数字,但是你确信两个玩家都知道这个数字,输出 0;如果连玩家也不知道,输出 -1。

More...


Linux 下有些时候我们运行一个进程需要一直挂着(这就是 VPS 的意义啊……),这时候需要把前台进程放到后台去。一般可以用 screen,但是如果这种后台进程挂多了,每个都开一个 session 会很不方便。前几天配置 aria2 的时候看到一个神奇的操作:可以配置成一个 service,直接 service aria2c start/stop/restart 就可以了!

More...


2019.10.09 Upd:这篇文章弃坑啦,以后直接放在 Lab 页面里了。

这篇文章作为我的颓废成果,暨萌新颓废指南……记录下我的 VPS 上建的东西。

生命不息,折腾不止!

More...


Description

Link

Ivan wants to make a necklace as a present to his beloved girl. A necklace is a cyclic sequence of beads of different colors. Ivan says that necklace is beautiful relative to the cut point between two adjacent beads, if the chain of beads remaining after this cut is a palindrome (reads the same forward and backward).

More...


Description

Yaroslav has n points that lie on the $Ox$ axis. The coordinate of the first point is $x_1$, the coordinate of the second point is $x_2$, ..., the coordinate of the n-th point is — $x_n$. Now Yaroslav wants to execute $m$ queries, each of them is of one of the two following types:

More...


Description

Link

In mathematical terms, the sequence $F_n$ of Fibonacci numbers is defined by the recurrence relation

$$F_1 = 1; F_2 = 1; F_n = F_{n - 1} + F_{n - 2} (n > 2)$$

DZY loves Fibonacci numbers very much. Today DZY gives you an array consisting of n integers: $a_1, a_2, \dots, a_n$. Moreover, there are $m$ queries, each query has one of the two types:

More...


留一点点的距离,让我与世界分离
曾经困扰我的恐惧,消失在我回忆
夜里冰冷的空气,我终于能呼吸
我留下自己的过去,抹掉眼泪的痕迹

矩阵乘法的很多应用都是围绕矩阵乘法的定义式展开的:

$$C[i,j]=\sum_{k=1}^{b} A[i,k]\ast B[k,j]$$

本质上是一种动态规划吧。

More...