1259 - CS I2P (II) 2017-2 Lee Quiz1 Scoreboard

Time

2017/09/15 13:52:00 2017/09/15 15:20:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11535 EasySort
11536 Triangle
11541 Fibonacci number

11535 - EasySort   

Description

Given an integer array, sort the array by ascending order and print the result .

Input

There are 2 lines:

First line is integer n ( n < 100000 ), which means the size of the input array.

Second line contains n integer seperate by space.

Output

Output the sorted array by ascending order, print a space after each integer .

Sample Input  Download

Sample Output  Download

Tags




Discuss




11536 - Triangle   

Description

Please print a triangle according to the input.

Input

The input contains three numbers: LAYER, INC, and SHIFT.

LAYER: Denoting the total layers in the triangle. (1 <= LAYER <= 20)

INC: For each layer, you should extend INC stars ('*')  toward left and right (e.g. If INC = 1, then the number of stars in each layer is 1 3 5 7....; if INC = 2, the the number of stars in each layer is 1 5 9 13 ...; if INC = 0, then the number of stars in each layer is 1 1 1...). (0 <= INC <= 39)

SHIFT: Denoting the distance for right shifting for the whole triangle. (0 <= SHIFT <= 9)

Output

Please reference the sample IO (You can view the download file).

The output should contain a complete triangle, and there are SHIFT spaces (' ') at the left of the lower-left star in the trinagle.

There are no tailing spaces at the end of each layer, and there is a newline character ('\n') at the end of each layer (including the last layer).

Sample Input  Download

Sample Output  Download

Tags




Discuss




11541 - Fibonacci number   

Description

The  Fibonacci sequence are the numbers in the following intergur sequence:

0,\;1,\;1,\;2,\;3,\;5,\;8,\;13,\;21,\;34,\;55,\;89,\;144,\; \ldots\; In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the first two numbers in the Fibonacci sequence are  0 and 1, and each subsequent number is the sum of the previous two.

F_n = F_{n-1} + F_{n-2},\!\,       

F_0 = 0,\; F_1 = 1.

You should enter an index of Fibonacci sequence ,and then output a Fibonacci numbers of this index

Input

First line contains an integer t, which indicates the number of test cases in the input. In the next t lines, each line contains an index of Fibonacci sequence

Output

For each case, output is a non-negative integer Fibonacci numbers of this index in a line.

Sample Input  Download

Sample Output  Download

Tags




Discuss