1556 - I2P18_EECS_Lab_5 Scoreboard

Time

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

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11196 Eight Queen
11219 Get your array and then sort it!
11611 Addition and Division of Big Number

11196 - Eight Queen   

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




11219 - Get your array and then sort it!   

Description

[Partial Judge]

Given a sequence of integers, sort it in increasing order by implementing the function my_sort().

The main code and the header code are provided as below.

There are two functions defined in the header file:

  • int* readInput();
  • void my_sort(int* B);

Function int* readInput() is given. It will read the input numbers, save it into an array, say Seq, and finally return the address of the array.
The first element of array Seq is the number of integers to be sorted. The following elements are the integers.

Function void my_sort(int* B) is the one leaved for you to implement. It take in a single argument B of type int*, whose value is the address of the address of the array Seq.

* Note that the address of the array Seq is returned by the function int* readInput().
* Also, you should be care of the actual type of the variable you want to access to. Do not be confused with the function definition.
* When submitting your code, remember to set Language option to "C: -O2 -lm -std=c99"

Input

A line of N integers seperated by a space in between.

100 <= N <= 1000.

The value of integer falls in the range of [-1000, 1000].

Input is handled by the provided function int* readInput(). You don't need to worry about it.

Output

A line of sorted integers seperated by a space in between. No extra space after the last integer. An newline character ('\n') is appended at the end.

You don't need to worry about it. It is handled in the provided main function.

Sample Input  Download

Sample Output  Download

Partial Judge Code

11219.c

Partial Judge Header

11219.h

Tags




Discuss




11611 - Addition and Division of Big Number   

Description

As we all know, all kinds of data type like int, long, etc have their limitation in representing numbers. 

For instance, if we use int to store some variable, it may not contain the value we want if the variable is bigger than 231, which is roughly the same as 2 * 109.

So it would get into trouble if we want to calculate some very large number, like 101000 + 1.

In this task, you are asked to implement a calculator that can make some simple calculation of big number possible.

For simplifying the question, we will give you several data groups containing two big numbers a and b, and a integer divisor c.  For each group, all we need is the integer part of (a + b)/c.

Hint: 

You can recall the very first experiment you learned addition. At that time the teacher may tell you that you should calculate the addition in each digit , only maintain the very right digit as the answer and send the others as the carry to the next digit. For instance, if we want to calculate 999 + 999, the following method might be well:

   9  9  9

   9  9  9

           +

-------

   8  8  8 (right most digit)

1  1  1      (carry)

           +

--------

1  9  9  8

You may use int array to record the big number and the upper method to calculate.

 

For division, you can also use some likely method.

We do the division from the very left digit of dividend(被除數) , calculate the result and pass the reminder to the right digit.

For instance, if we want to calculate 199 / 2:

             9    9

    ——————

2 )1     9     9

      1     8

   ————————

             1      9

             1      8

   ————————

                    1    

Characters in red are reminders.

 

Other better method is encouraged.

 

 

Input

The input contains several lines.

The very first line is a integer N representing the total times of calculation. (1 <= N < 50)

From the second line to the last line, each three lines forms a group representing a calculation. 

The first line and the second line of each group are two numbers, which are in decimal, bigger than or equal to 0 and smaller than 101000. For making the question easier, the lengths of the two numers are just the same. It is possibe for the numbers beginning with 0.

The third line of each group is the divisor (bigger than 0 and smaller than 231-1).

Output

The answer of each group.

Please do not pad 0 in your answer. Eg 87 is a legel answer but 087 is illegal.

You should add a newline at the end of the answer.

Sample Input  Download

Sample Output  Download

Tags




Discuss