SkyWT

Fighting 2019!

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

Read more...

发布 0 条评论

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).

Read more...

发布 1 条评论

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:

Read more...

发布 0 条评论

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:

Read more...

发布 0 条评论

The cool breeze blows gently, the flowing water ripples steadily.

"Flowing and passing like this, the water isn't gone ultimately; Waxing and waning like that, the moon doesn't shrink or grow eventually."
"Everything is transient in a way and perennial in another."

Kanno doesn't seem to make much sense out of Mino's isolated words, but maybe it's time that they enjoy the gentle breeze and the night sky — the inexhaustible gifts from nature.

Gazing into the sky of stars, Kanno indulges in a night's tranquil dreams.

发布 0 条评论

引言

Bitset 是一种利用对布尔数组压位存储的方法,达到优化时间常数、空间常数的目的的黑科技。利用 Bitset,可以方便地对布尔数组进行按位逻辑运算,优化 32 或 64 的常数。在某些素质极差的卡常题中运用会有奇效。

Read more...

发布 0 条评论

Description

牛客练习赛 17 F 【玩游戏】:Link

给定两个串 S 和 T,|S| >= |T|。alice 和 bob 轮流操作串 S,bob 先手。
对于每次操作,alice 或 bob 会选择删掉 S 的第一位或最后一位。当操作以后的串的长度等于 |T| 时,游戏停止。如果停止时的串=T,则 alice 获胜,否则 bob 获胜。问在 alice 和 bob 均采取最优策略的情况下,谁赢?

Read more...

发布 0 条评论

转自知乎:八大排序算法稳定性分析,原来稳定性是这个意思……
这是 €€F 非常喜欢的排序稳定性分析……

稳定性定义: 排序前后两个相等的数相对位置不变,则算法稳定。
稳定性的好处: 从一个键上排序,然后再从另一个键上排序,第一个键排序的结果可以为第二个键排序所用。

各排序算法的稳定性:

  1. 堆排序、快速排序、希尔排序、直接选择排序不是稳定的排序算法;
  2. 基数排序、冒泡排序、直接插入排序、折半插入排序、归并排序是稳定的排序算法。

Read more...

发布 0 条评论