地址：戳这里

## Description

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

10/27

22:08

地址：戳这里

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

09/16

14:35

地址：戳这里

You are given a string S which consists of 250000 lowercase latin letters at most. We define F(x) as the maximal number of times that some string with length x appears in S. For example for string ‘ababa’ F(3) will be 2 because there is a string ‘aba’ that occurs twice. Your task is to output F(i) for every i so that 1<=i<=|S|. Read More →

09/15

00:02

地址：戳这里

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 c_{1}, c_{2}, …, c_{k},and I wonder how many consecutive substring of string s that each c_{i} has occur even times in it.

Two substring with the same content but different position are considered different.

There is a string s only consist of first 20 lowercase English letters.

And we have several queries,each time I have k letters c

Two substring with the same content but different position are considered different.

09/8

15:39

地址：戳这里

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

08/15

21:25

地址：戳这里

Mislav and Marko have devised a new game, creatively named Rotate. First, Marko imagines a number sequence of length *N* and divides it into sections, with each section containing *K* numbers (*K* evenly divides *N*). The first section contains numbers in the first *K*positions in the sequence, the second section the following *K* positions, and so on. Read More →

08/15

21:18

地址：戳这里

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?

08/15

21:12

地址：戳这里

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

地址：戳这里

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.

Now, Mph want you to calculate the minimum cost in his travel plan.

08/7

00:21

地址：戳这里

Problem Description

There are n soda living in a straight line. soda are numbered by 1,2,…,n from left to right. The distance between two adjacent soda is 1 meter. Every soda has a teleporter. The teleporter of i-th soda can teleport to the soda whose distance between i-th soda is no less than li and no larger than ri. The cost to use i-th soda’s teleporter is ci.

The 1-st soda is their leader and he wants to know the minimum cost needed to reach i-th soda (1≤i≤n).

08/5

01:00

地址：戳这里

Problem Description

As we all kown, MZL hates the endless loop deeply, and he commands you to solve this problem to end the loop.

You are given an undirected graph with n vertexs and m edges. Please direct all the edges so that for every vertex in the graph the inequation |out degree − in degree|≤1 is satisified.

The graph you are given maybe contains self loops or multiple edges.

You are given an undirected graph with n vertexs and m edges. Please direct all the edges so that for every vertex in the graph the inequation |out degree − in degree|≤1 is satisified.

The graph you are given maybe contains self loops or multiple edges.