SkyWT

SkyWT

我们的征途是星辰大海

✨ 全新设计的 Daydream 主题,强大的功能集成为你提供优雅的体验。欢迎使用。

Description

给出一个长度为 n 的数列,$2\leq n\leq 4\ast 10^5$,每个数字 $a_i$ 都在 $[1,20]$ 内。
可以对这个数列中相邻的两个数字交换位置,最终要使得相同的数字都在一起。
求最小交换次数。

Link

More...


Description

Link: LightOJ 1873 DNA Sequence

You are given a list of strings over the alphabet A (for adenine), C (cytosine), G (guanine), and T (thymine), and your task is to find the shortest string (which is typically not listed) that contains all given strings as substrings. If there are several such strings of shortest length, find the smallest in alphabetical/lexicographical order.

Time Limit: 4 second(s)
Memory Limit: 32 MB

More...