SkyWT

Welcome!

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

Read more...

发布 0 条评论

\begin{bmatrix} x_{11} & x_{12} & x_{13} \\ x_{21} & x_{22} & x_{23} \\ x_{31} & x_{32} & x_{33} \end{bmatrix}

每增加一个维度,世界便会增加无限的美感。

Read more...

发布 0 条评论

简单来说,数位 DP 大概就是把一个数字拆开按位进行 DP 的一种思想。

HDU 3555 Bomb

The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the current number sequence includes the sub-sequence "49", the power of the blast would add one point.
Now the counter-terrorist knows the number N. They want to know the final points of the power. Can you help them?

Read more...

发布 0 条评论

Problem Description

YJJ is a salesman who has traveled through western country. YJJ is always on journey. Either is he at the destination, or on the way to destination.
One day, he is going to travel from city A to southeastern city B. Let us assume that A is (0,0) on the rectangle map and B (10^9,10^9). YJJ is so busy so he never turn back or go twice the same way, he will only move to east, south or southeast, which means, if YJJ is at (x,y) now (0\leqslant x\leqslant 10^9,0\leqslant y\leqslant 10^9), he will only forward to (x+1,y), (x,y+1) or (x+1,y+1).

Read more...

发布 0 条评论

在一维线性动态规划里,我们经常见到形如 f(i)=min/max(f(j)+c_i)(其实可以看成 f(i)=min/max(a_i+b_j) )这样形式的转移方程。朴素做法是 \Theta (N^2)。显然这样的形式可以用单调队列维护,优化到 \Theta (N)。但是如果遇到 f(i)=min/max(a_i\ast b_j+c_i+d_j) 这样的,似乎用单调队列就难以维护了……因为 a_i\ast b_j 既与 i 有关,又与 j 有关。这时候就要用到另一种优化方式:斜率优化。

Read more...

发布 0 条评论

今天的 XY 题居然是递推专题,五道题目全都是递推,30+个人 AK 了……

递推是按照一定的规律来计算序列中的每个项,通常是通过计算前面的一些项来得出序列中的指定项的值。其思想是把一个复杂的庞大的计算过程转化为简单过程的多次重复,该算法利用了计算机速度快和不知疲倦的机器特点。

Read more...

发布 0 条评论