1552 - I2P18_EECS_Mid_2 Scoreboard

Time

2018/12/05 08:00:00 2018/12/05 10:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12085 EECS_2018_MID2-1
12086 EECS_2018_MID2-2
12087 EECS_2018_MID2-3
12088 EECS_2018_MID2-4

12085 - EECS_2018_MID2-1   

Description

Simulate the process of arithmetics(四則運算) in form of prefix notation and calculate the answer.

The characteristic of prefix notation is that operators always precede their operands rather than between them. For example, we see an equation '1 + 2' in conventional infix notation . In prefix notation the expression becomes '+ 1 2'. Another example is (3 - 6) * 2. In prefix notation it becomes ' * - 3 6 2'.

Input

An equation in prefix notation.

Operands are integers in the range between 0 and 9.

There are four operators in this problem: addition('+'), subtraction('-'), multiplication('*'), and division('/').

At the end of an equation, there is a '=' symbol. 

No blank space between elements.

No calculate errors(for example, 5/0) will happen.

The length of equations (includes '=') is less than 40.

Output

Show the answer of the equation

Note that the answer may be a decimal number, so you are asked to use '%.3f' to show the answer, or you'll get WA even if your answer is correct.

No newline character at the end. 

Sample Input  Download

Sample Output  Download

Tags




Discuss




12086 - EECS_2018_MID2-2   

Description

Given an m ✕ n matrix A, please calculate the 2x2 max-pooling of A.
Both m and n are multiples of 2.
The computation of 2x2 max-pooling is to find the maximum for each 2x2 block of A.
For example, if A is
1 2 3 4 5 6
6 5 4 3 2 1
9 8 7 6 5 4
4 5 6 7 8 9
the output should be
6 4 6
9 7 9
because they are the maximal values of the partitions:
1 2|3 4|5 6
6 5|4 3|2 1
---+---+---
9 8|7 6|5 4
4 5|6 7|8 9


Note: The is a partial judge problem. We have already handled the input and output for you. All you have to do is to implement the function "max_pooling":

void max_pooling(int A[500][500], int *m, int *n);

Input

The first line contains two integers m, n, representing the dimensions of A.
The next m lines contain n integers a_ij, j=1,...n, as the entries of the mth row of A.

It is guaranteed that
1 ≤ m, n ≤ 500
We have already handled the input for you.

Output

Please print the result of 2x2 max-pooling.
We have already handled the output for you.

 

Sample Input  Download

Sample Output  Download

Partial Judge Code

12086.c

Partial Judge Header

12086.h

Tags




Discuss




12087 - EECS_2018_MID2-3   

Description

Find the largest island on the map and print its size.
Take the following map for example:
~~~~~~#~
~###~~~~
~##~~~~#
~~~###~~
~~~###~~
~~~~~~~~
~~~~##~~

The character '#' means land and the character '~' means water.
The size of the largest island on the map is the 6.
Note that two '#'s are considered connected only if they are horizontal or vertical neighbors. Diagonal neighbors are not considered connected.

Input

The first line contains two integers m, n, representing the height and width of the map.

The next m lines contain n characters, either '~' or '#' for the mth row of the map.

It is guaranteed that 1 ≤ m, n ≤ 1000

Output

The size of the largest island on the map. Please include a newline character '\n' at the end of the output.

Sample Input  Download

Sample Output  Download

Tags




Discuss




12088 - EECS_2018_MID2-4   

Description

Each chessboard has numbers in the range 1 to 100 written on each square and is supplied with 8 chess queens. The task is to place the 8 queens on the chess board in such a way that no queen threatens another one, and so that the sum of the numbers on the squares selected is the maximum . (For those unfamiliar with the rules of chess, this implies that each row and column of the board contains exactly one queen, and each diagonal contains no more than one queen.)

Write a program that will read in the number and details of the chessboards and determine the highest scores possible for each board under these conditions.

Input

Input will consist of K (the number of boards), on a line by itself, followed by K sets of 64 numbers, each set consisting of eight lines of eight numbers. Each number will be a non-negative integer less than 100. Each case is separated by a blank line. There will never be more than 20 boards.

Output

The outputs of all test cases should be printed in order. For each test case a line, print the highest score.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss