1338 - I2P (I) 2017_Yang_Lab4 Scoreboard

Time

2017/11/16 13:30:00 2017/11/16 14:50:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11194 Stairs Climbing
11214 Find Palindrome
11676 Eulerian_circle

11194 - Stairs Climbing   

Description

Bob is a man who wants to climb 3 step stairs.

Suppose he can only climb 1 or 2 step at a time.

Then , there are 3 possible ways to climb 3 step stairs

          (1)  1 step + 1 step + 1 step
          (2)  1 step + 2step
          (3)  2 step + 1step

The question is : if Bob want to climb X step stairs. 

How many possible ways are there to climp X step stairs.
 

 

 

Input

An integer N represents the number of testcases.

Then , there are following N lines.

Each line contain an integer X that  represents the number of stairs in that testcase.

P.S. 1<= X <=40

Output

An integer represents the number of possible way to climb N stairs.

Note that you have to add '\n' at the end of output

 

Sample Input  Download

Sample Output  Download

Tags




Discuss




11214 - Find Palindrome   

Description

Palindrome is a string that is identical to its reverse, like "level" or "aa". Given a string, find if there is a palindrome with length greater than or equal to 2 in the string.

 

Input

The first line of the input is an integer N, indicating the number of test cases.

In the next N lines, each contains a string. The length of each string is less than 1000. The number of test cases is less than or equal to 10.

Output

In each test case, output “Yes” if there is a palindrome with length greater than or equal to 2 in the input. Otherwise, output “No”. 

Sample Input  Download

Sample Output  Download

Tags




Discuss




11676 - Eulerian_circle   

Description

There are N different points , labeled from 1 to N. You are asked to draw a path connecting all the points to form a circle(環), and each point is allowed to be visited more than once. For example, the following 5 points can be connected into the shape of a circle in the order of 1,2,3,4,5,1 . 

It is promised that there exists a path from each point to all the other points.

You need a program to check whether the graph can be connected as a circle or not.

Input

There are several test cases, but no more than 10 test cases. In each test case, there’re two numbers N and M in the first line, indicating that there’re N points and M lines on the paper. Each line can be used only once.

In the next M lines, each line contains two numbers i and j, which means there’s a line connecting point i and point j.

   •     1 <= N <= 10^4

   •     N-1 <= M <= 10^5

   •     1 <= i, j <= N

   •     The given graph contains only one connected component which connects all the points. There’s not a single point that cannot reach all the other points.

Output

If the graph can be connected to form a circle, print Yes; otherwise, print No.

Sample Input  Download

Sample Output  Download

Tags




Discuss