| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 10905 | Mouse Maze |
|
| 10910 | Pointer Char Array |
|
| 11711 | Dynamic 3D array |
|
| 12498 | Parital Judge Example |
|
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.
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.
The above case has 4 different paths from S to F as follows:
If there is no way from S to F, then print -1.
Input
The first line has an integer N(1<=N<=10^6), which means the number of test cases.
For each case, the first line has two integers. The first and second integers R and C (3<=R, C<=500) 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
Print out all the number of paths for each case, and there is a new line character at the end of each line.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Given a character pointer *ptr, and a character array *ary. Use malloc function to allocate memory to *ary with size = (end - start), where end and start are two given variables. For example, if start = 48 and end = 63, ary[0] is ‘0’, ary[1] is ‘1’, and the last element in the array is ary[14] is ‘>’.

Initially, pointer *ptr points to ary[0]. Next, a sequence of pairs (num,offset) will be given. For each pair, use *ptr to output the character in the position &ary[num]+offset. Continuing with the above example, if (num, offset) = (4, 4), then output = ‘8’.

main.c
function.h
Input
The first line is start and end
The other line is num and offset
If num is -1 then stop the program.
Output
Print each pointer of *ptr + num + offset
Note that you need to print a newline character ‘\n’ after each char.
Sample Input Download
Sample Output Download
Partial Judge Code
10910.cPartial Judge Header
10910.hTags
Discuss
Description
In this problem, you are asked to design two functions
1.
unsigned*** new_3d_array(unsigned n,unsigned m,unsigned k);
malloc an n*m*k 3D unsigned array, and then return its address. The main function will check the correctness of your array.
2.
void delete_3d_array(unsigned ***arr);
Free the memory space of your array that was previously allocated by using malloc. Be careful about the memory uage of your program allocated dynamically so as to avoid MLE.
The two functions have been declared in function.h, and you are asked to complete the function definitions in function.c.
Your program should construct the 3D array by using only three malloc function calls. Notice that malloc is a time-consuming operation.
Note: for OJ submission:
Step 1. Submit only your function.c into the submission block. (Please choose C compiler)
Step 2. Check the results and debug your program if necessary.
Input
Please refer to the main function.
The input only has one line, consisting of five positive integers t,n,m,k,r separated by space characters, where t is the number of tests, (n,m,k) represents the array size, and r is a parameter for testing.
Note that n*m*k<=10000000 and t*n*m*k<=60000000
Output
In order to test your array's correctness, we will use your array to do some computations and output the results.
Sample Input Download
Sample Output Download
Partial Judge Code
11711.cPartial Judge Header
11711.hTags
Discuss
Description
This is the partial judge example (another method for online judge), you are asked to design a function below:
int call_add(int a, int b);
(implement a function to add two pass value togeter)
Note: for OJ partial judge submission:
Step 1. Submit only your function.c into the submission block. (Please choose C compiler)
Step 2. Check the results and debug your program if necessary.
/* the content below is what you need to copy and submit to oj*/
int call_add(int a, int b){
return a + b;
}
More information about the different of partial judge and normal judge

Input
Please refer to the main function.
The input only one line, contain two number a and b (1 < a < 10, 1< b < 10)
Output
Output a + b.