| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 12112 | EECS_2018_FINAL_1 |
|
| 12113 | EECS_2018_FINAL_2 |
|
| 12114 | EECS_2018_FINAL_3 |
|
| 12115 | EECS_2018_FINAL_4 |
|
| 12116 | EECS_2018_FINAL_5 |
|
Description
「與練習題相同」
Writer: jjjjj19980806 Description: pclightyear Difficulty: ★★☆☆☆
Given a list of students and their score, you have to sort their score in decreasing order.
If there are many students with the same score, you need to maintain their relative order in the original list.
That is, if whenever there are two students A and B with the same score and with A appearing before B in the original list, A will appear before B in the sorted list.
Reference: https://en.wikipedia.org/wiki/Category:Stable_sorts
Input
The first line contains one integer n, representing the number of students.
The next n lines contain a string and an integer si and ai, representing the name of each student and his/her score.
It is guaranteed that :
- n ≤ 105
- 1 ≤ | si | ≤ 20
- 0 ≤ aij ≤ 100
Output
After sorting, please output the list of students' names, each name with a line.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
「與練習題相同」
Writer: jjjjj19980806 Description: pclightyear Difficulty: ★☆☆☆☆
Given a linked list, you have to reverse it and output the result.
You have to implement four function:
1. Node* Create_List(Node*, int);
This function is used to create the linked list according to the input.
2. Node* Reverse_List(Node*);
This function is used to reverse the given linked list.
3. void Print_List(Node*);
This function is used to print out the key value in the linked list.
4. void Free_List(Node*);
This function is used to free the memory space.
Input
The first line contains one integer n, representing the number of nodes in the linked list.
The next lines contains n integers, each integer represents a node in the linked list.
It is guaranteed that :
- 1 ≤ n ≤ 10
- 0 ≤ ai ≤ 100
Output
You need to output the reversed linked lists.
Each key value is separated by "->".
Sample Input Download
Sample Output Download
Partial Judge Code
12113.cPartial Judge Header
12113.hTags
Discuss
Description
「與練習題相同」
Writer: jjjjj19980806 Description: pclightyear Difficulty: ★★★☆☆
In linear algebra, the determinant (行列式) is a useful value that can be computed from the elements of a square matrix. The determinant also has many useful properties. For example: Assume we have a square matrix A. Then the determinant of A equals to zero if and only if A is not invertible.
Given a n × n square matrix A, you have to calculate the determinant of A. (Denoted by det(A))
Note:
(1) We can define the determinant of a 2 × 2 matrix as below:

(2) We can calculate the determinant of a 3 × 3 matrix as below:

Input
The first line contains one integer n, representing the size of A.
The next n lines contains n integers aij, representing each entry in A.
It is guaranteed that :
- 1 ≤ n ≤ 8
- -16 ≤ aij ≤ 15
Note that det(A) may exceed INT.
Output
Please output a line contains the value of det(A).
Sample Input Download
Sample Output Download
Tags
Discuss
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
Description
There are n factories. Each factory can be assigned to produce one of the three kinds of cars (car A, car B, & car C). The goal is to assign x factories to produce car A, y factories to produce car B, and z factories to produce car C so that the net profit is maximized. It is possible that some factories do not produce any cars (i.e. x + y + z <= n). Note that z can only be 1.
The net profit of producing car A, car B, or car C for each factory will be given. Your program needs to print the names of the x factories that produce car A in lexicographical order. If there are multiple answers, you need to print the one such that the total net profit of car A is maximum.
Input
The first line contains four integers n, x, y, z, representing the total number of factories, the number of factories planned to produce car A, the number of factories planned to produce car B, and the number of factories planned to produce car C.
Each of the next n lines contains one string si and three integers ai, bi, ci, representing the name of each factory and the net profit each factory can make if it is assigned to produce car A or car B or car C.
It is guaranteed that
- 0 < n, x, y ≤ 500
- z = 1
- x + y + z ≤ n
- 1 ≤ | s i | ≤ 20
- 0 < a i i, b i i, c i i < 1000000
- ai ≠ aj, bi ≠ bj if i ≠ j.
- No duplicate names.
Output
Find the assignment of the car type for each factory so that the profit is maximized. Print the list of x factories that need to produce car A in lexicographical order.