SkyWT

SkyWT

我们的征途是星辰大海

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

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


Description

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

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

More...


快看看 CCF 是怎么把初赛完成脑筋急转弯竞赛的……

孙某和张某是考古学家老李的学生。有一天,老李拿了一件古物来考验两人,两人都无法验证出来这件古物试谁的。老李告诉了孙某拥有者的姓,告诉张某拥有者的名,并且在纸条上写下以下几个人的人名,问他们知道谁才是拥有者?
纸条上的名字有:沈万三、岳飞、岳云、张飞、张良、张鹏、赵括、赵云、赵鹏、沈括。

  • 孙某说:如果我不知道的话,张某肯定也不知道。
  • 张某说:刚才我不知道,听孙某一说,我现在知道了。
  • 孙某说:哦,那我也知道了。

请问:那件古物是谁的?

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


简单来说,数位 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?

More...


据说今年所有学校都没有推荐名额???

More...


很多题目的贪心想法都是一个简单粗暴的贪心加上可“反悔”的操作。这样可以确保答案的正确性。

Description

You're Zhu Rengong, a formidable hero. After a number of challenging missions, you are finally facing the final Boss – a black dragon called Heilong. Due to his overwhelming power, you have to plan your actions carefully.

More...


坠痛苦的是,POJ 的辣鸡 G++ 编译器不支持 long long,害得我调试调了半天……

Description

For every pair of triplets, $T_a = (I_a, J_a, K_a)$ and $T_b = (I_b, J_b, K_b)$, we define the difference value between $T_a$ and $T_b$ as follows:

$$ D(T_a, T_b) = \max (I_a − I_b, J_a − J_b, K_a − K_b) − \min (I_a − I_b, J_a − J_b, K_a − K_b) $$

Now you are given $N$ triplets, could you write a program to calculate the sum of the difference values between every unordered pair of triplets?

More...


这题思路很简单,但是调试花了我一个下午……最后发现是一种情况没取 abs……(吐血)

题目链接:POJ 3977 Subset

More...


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

More...