1099 - I2P EECS 2016 HW9 Scoreboard

Time

2016/12/10 23:00:00 2016/12/14 09:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11248 Eating Group
11250 The Cost to Pass the Forest

11248 - Eating Group   

Description

[Partial Judge: C]

There are N hungry people, numbered from 1 to N. Each of them is going to have a lunch with someone else or alone.

With the given input, try to find out that which restaurant to go for each person. Each restaurant is also represented by an integer.


 

Notice:

You need to implement all three functions defined in the 11248.h header file.

There are two arrays of length 100 (a,b) leaved for you to implement your method. That should be enough.

 

Read input hint:

int i, a;
scanf("%d" , &a);
for ( i=0; i<N-1; i++) {
    scanf(",%d" , &a);
    ...

}

Input

The input contains three lines.

First line only has a single number N (N<=100), representing the total number of hungry people.

Second line is a comma-seperated sequence of N integers. The ith integer indicates who will ith person eat with. 0 means unknown.

Third line is also a comma-seperated sequence of N integers. The ith integer indicates which restaurant will ith person eat at. 0 means unknown. No '\n' at the end of this line.

Note, ith entry in second line is zero iff ith entry in third line is non-zero.

Output

Output a line of N comma saperated integers with no trailing \n behind.

Each integer indicates the restaurant to eat for the corresponding person.

Sample Input  Download

Sample Output  Download

Partial Judge Code

11248.c

Partial Judge Header

11248.h

Tags




Discuss




11250 - The Cost to Pass the Forest   

Description

The forest is described as follows:

S: the start of the forest

T: the destination of the forest

#: the passway in the forest

*: the trees in the forest

Now please count the cost to pass through the forest.

Input

The first line of the input give two integer M N, representing the height and the width of the forest.

Then the following M*N arrays gives the description of the forest.

Note. 3<=M, N<=100

Output

Give the minimum cost(steps) to pass through the forest.

If the destination is unreachable, the cost will be 0.

Remember to print a '\n' at the end of the output.

Sample Input  Download

Sample Output  Download

Tags




Discuss