亟隐

朝不闻道,夕亦死可矣

04/30
23:45
流年逝

2016年4月30日

    vawait在最近的一个月内经历了数次悲伤的事情,命途多舛从未改变过。

    而在今日,他和十数年前的羁绊做了个了结,并且发现了生命中一些美好的事物。

    或许他能承受得更多,或许还是会有曙光。

12/14
23:48
流年逝

I retired.

    我退役了。

    我退役了。

    我退役了。

    我退役了。

    我退役了。

    我退役了。

    我退役了。

    我退役了。

    vawait你就是个大傻逼。

10/27
22:08
图论 算法区

BZOJ 2144 跳跳棋

地址:戳这里

Description

跳跳棋是在一条数轴上进行的。棋子只能摆在整点上。每个点不能摆超过一个棋子。我们用跳跳棋来做一个简单的游戏:棋盘上有3颗棋子,分别在a,b,c这三个位置。我们要通过最少的跳动把他们的位置移动成x,y,z。(棋子是没有区别的)跳动的规则很简单,任意选一颗棋子,对一颗中轴棋子跳动。跳动后两颗棋子距离不变。一次只允许跳过1颗棋子。 写一个程序,首先判断是否可以完成任务。如果可以,输出最少需要的跳动次数。 Read More →

09/15
00:02
DP 数学 算法区

HDU 4626 Jinkeloid

地址:戳这里

Problem Description
After listening several songs of Jinkeloid,I come up with this problem :).
There is a string s only consist of first 20 lowercase English letters.
And we have several queries,each time I have k letters c1, c2, …, ck,and I wonder how many consecutive substring of string s that each ci has occur even times in it.
Two substring with the same content but different position are considered different.

Read More →

09/8
15:39
数学 算法区

BZOJ 3930 [CQOI2015]选数

地址:戳这里

Description

 我们知道,从区间[L,H](L和H为整数)中选取N个整数,总共有(H-L+1)^N种方案。小z很好奇这样选出的数的最大公约数的规律,他决定对每种方案选出的N个整数都求一次最大公约数,以便进一步研究。然而他很快发现工作量太大了,于是向你寻求帮助。你的任务很简单,小z会告诉你一个整数K,你需要回答他最大公约数刚好为K的选取方案有多少个。由于方案数较大,你只需要输出其除以1000000007的余数即可。

Read More →

08/15
21:18
算法区

CodeForces Gym 100203D Different vectors

地址:戳这里

You are given a set of N vectors, each vector consists of K integers. Vector X is equivalent to Y (denoted X ≡ Y) iff there exist a bijection and an integer r, such that for each i in the range [0..K - 1].

For example, (1, 2, 2, 3) ≡ (22, 3, 4, 22), with r = 2 and f(22) = 2, f(3) = 3 and f(4) = 1. But (22, 3, 22, 4) is not equivalent to(1, 2, 2, 3).

How many pairwise nonequivalent vectors are there in a given set of N vectors?

Read More →

08/15
21:12
算法区

CodeForces Gym 100203A Ariel

地址:戳这里

King Triton really likes watching sport competitions on TV. But much more Triton likes watching live competitions. So Triton decides to set up a swimming competition in the kingdom Merfolk. Thousands of creatures come to take part in competition, that’s why it is too difficult to take the first place. For the King’s beloved daughter Ariel this competition is the first in her life. Read More →

08/14
17:05
数据结构 算法区

HDU 5380 Travel with candy

地址:戳这里

Problem Description
There are n+1 cities on a line. They are labeled from city 0 to city n. Mph has to start his travel from city 0, passing city 1,2,3…n-1 in order and finally arrive city n. The distance between city i and city 0 is ai. Mph loves candies and when he travels one unit of distance, he should eat one unit of candy. Luckily, there are candy shops in the city and there are infinite candies in these shops. The price of buying and selling candies in city i is buyi and selli per unit respectively. Mph can carry at most C unit of candies.
Now, Mph want you to calculate the minimum cost in his travel plan.

Read More →