2180 - I2P(I)2020_Hu_hw8 Scoreboard

Time

2020/11/23 21:00:00 2020/11/30 18:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12511 Pointer Sorting
13004 Maze paths
13005 Domino Tiling

12511 - Pointer Sorting   

Description

You will need to write a function to solve sorting problem.

int** s(int* ptr,int len);

ptr is a pointer, len is the length of ptr and is a complete square number, after we allocate it space according by the input.

After sorting ptr in non-descending order, you need to put it in a 2D array in row-major order, then return it in int** type.

 

Input

you don't need to worry it

Output

A 2D matrix

 

Remember to change line each row.

Sample Input  Download

Sample Output  Download

Partial Judge Code

12511.c

Partial Judge Header

12511.h

Tags




Discuss




13004 - Maze paths   

Description

Write a program that simulates a mouse in a maze. The program must count all the number of paths the mouse can take from the starting point to the final point, and the shortest step count among these paths.

The maze type is shown in following figure:

S$###
$$#$$
$$$##
##$$F

it consists of S (starting point), #(wall), $(road) and F (final point). The mouse can move in the four directions: up, down, left, and right. Note that each $(road) can only be passed for one time in each path.

If there is no way from S to F, then print 0 -1.

Input

The first line has an integer N(1<=N<=3), which means the number of test cases.

For each case, the first line has two integers. The first and second integers R and C (4<=R, C<=100) represent the numbers of rows and columns of the maze, respectively. The total number of elements in the maze is thus R x C.

The following R lines, each containing C characters, specify the elements of the maze.

Output

Please output the possible path counts from S to F, followed by the shortest step count among these paths. It is guaranteed that the possible paths counts won't exceed 100000.

Sample Input  Download

Sample Output  Download

Tags




Discuss




13005 - Domino Tiling   

Description

We have a lot of tiles with 2x1 domino shapes, these shapes may be rotated. Given N, please write a function to calculate how many ways are there to tile a 3xN board.

 

For example, given a 3x2 board, there are 3 ways to tile the board:

Input

The input contains an even integer N (2<=N<=20).

Output

Please output the possible tile counts, it is guaranteed that the answer can be stored in an int, we encourage you to simulate all the possible solution by recursive function, not directly by mathematic recursion. 

Sample Input  Download

Sample Output  Download

Tags




Discuss