| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 11865 | Number Maze |
|
| 11890 | Santa List |
|
| 11917 | Mario and Coins |
|
| 11934 | All Pair Shortest Paths - Cost |
|
| 11948 | Partition Step of QuickSort (CS2351) |
|
Description
- each preceding number is NOT a factor of its immediately successive number
- EX: 1->3 (X)
- EX: 2->6 (X)
- EX: 3->3 (X)
- EX: 3->1 (O)
- EX: 3->4 (O)
- from the top-left corner to the bottom-right corner
- Each number can be reached by up to four directions
- Matrices are consisted of 1~9
- Matrix width and height < 100
Input
The first number is the total number of matrices.
The second and third numbers are the width and height of the first matrix.
Then the first matrix is listed.
So on and so forth.
Output
Repeat all inputs.
Additionally print Yes or No
※There is no white space after last element in each line of matrix.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Objective
⁍ Find out the Santa list of Christmas gifts
⁍ Each node stores a child name and the gift
⁍ Naughty kids can only get a lump of coal
⁍ Examples:
(Andy,paper)->(Sandy,Candy)->(David,coal)
Requirements
⁍ SantaList will be initialized with the input at the first line
⁍ AppendList: The gift list can be appended (good kids should be placed before naughty kids)
◦ Assuming no child's name repeat.
◦ Only naughty kids will get "coal". (In other words, "coal" will not appear in SantaList and AppendList)
⁍ NaughtyKid: He will check the naughty list and get names one by one
◦ Each naughty kid’s gift will be replaced with coal and move to the end of the list.
◦ Naughty kids can be named many times, and each time they are moved to the end of the list.
⁍ You should find out the final Santa List
Input
⁍ The last line of input is "End", and we only need to print the result when get the "End".
Input format:
<command> <n> < data (or data pair) repeat n times>
n is an integer and n ≥ 0

Output
⁍ First line: Empty or SantaFinalList
⁍ Second line: List of children and their corresponding gifts (or coal)
◦ If it's Empty, only need to print the first line.
◦ Connect with symbols "->"
◦ No space in between

Sample Input Download
Sample Output Download
Tags
Discuss
Description
- Mario is in a maze, please help Mario to find max available number of coins at the Nth step,
- There are four direction(up, down, left, right) he can move.
- You can not go back.
- ex: N=2, It can not be considered as 1(first step at (1, 4)) -> 9(second step at (2, 4))
- Hint: Level-order tree traversal
Input
- Zero means wall.
Output
Sample Input Download
Sample Output Download
Tags
Discuss
Description
- Convert the nonzero digits of the matrix into a graph
- Print out the shortest path of each pair of nodes and cost.
- Each cell in the matrix contains a digit value (ranged from 0 to 9)
- 0 represents no edge between two nodes
- Nonzero digits represent the weights of two node
Input
- Number of matrices
- Given the number of vertices.
- 1 ≦ Number of vertices ≦ 100
- A matrix contains a digit value (ranged from 0 to 9)
- 0 represents no edge between two nodes

Output
- Print out the cost for each pair in row major order.
- Cost(from,to):xxx
- Print a new line between matrices.

Sample Input Download
Sample Output Download
Tags
Discuss
Description
Given
- List of distinct integers
- Required order: ascending or descending
Perform the partition step of QuickSort once
- Use the last number as the pivot
- Do swaps to partition the list according to the pivot
- Print out the list


Note:
The total score of quiz 5 will be 160. (20 points for each input)
Input

Output
