Problem DescriptionWhen playing DotA with god-like rivals and pig-like team members, you have to face an embarrassing situation: All your teammates are killed, and you have to fight 1vN.There are two key attributes for the heroes in the game, health
Problem Description A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties. There is exactly one node, called
Counting Binary TreesTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 485 Accepted Submission(s): 146Problem DescriptionThere are 5 distinct binary trees of 3 nodes:Let T(n) be the number of
Problem DescriptionBoudreaux and Thibodeaux are on the road again . . ."Boudreaux, we have to get this shipment of mudbugs to Baton Rouge by tonight!""Don't worry, Thibodeaux, I already checked ahead. There are three underpasses and our 18-wheeler
So you want to be a 2n-aire?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 201 Accepted Submission(s): 146Problem DescriptionThe player starts with a prize of $1, and is asked a sequence of
What Is Your Grade?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6917 Accepted Submission(s): 2122Problem Description“Point, point, life of student!”This is a ballad(歌謠)well known in
DescriptionYou are given two sequences of integer numbers. Write a program to determine their common increasing subsequence of maximal possible length.Sequence S1 , S2 , . . . , SN of length N is called an increasing subsequence of a sequence A1 , A2
DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 <= i <= N) we want to know the
Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, ..., xm> another sequence Z = <z1, z2, ..., zk> is a subsequence of X if there exists a
Problem DescriptionGive a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1. InputOne positive integer on each line, the value of n. OutputIf the minimum x exists, print a line with 2^x mod n = 1.Print 2^? mod n = 1 otherwise.You
Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers. Write a program to find and
Problem DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the minimal number of characters to be
Given a string containing only 'A' - 'Z', we could encode it using the following method: 1. Each sub-string containing k same characters should be encoded to "kX" where "X" is the only character in this sub-string.2. If the length of the sub-string
DescriptionA numeric sequence of ai is ordered ifa1 < a2 < ... < aN. Let the subsequence of the given numeric sequence (a1,a2, ..., aN) be any sequence (ai1,ai2, ..., aiK), where 1 <=i1 < i2 < ... < iK <=N. For example,
Problem DescriptionThis is a problem from ZOJ 2432.To make it easyer,you just need output the length of the subsequence. InputEach sequence is described with M - its length (1 <= M <= 500) and M integer numbers Ai (-2^31 <= Ai < 2^31) -