2684 - I2P(I)2022_Hu_Hw11 Scoreboard

Time

2022/12/19 21:00:00 2022/12/26 18:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
13372 Pointer Magic
13743 Grades
13745 Matrix tros
13749 Brokenotkeyboardot

13372 - Pointer Magic   

Description

After getting rejected by a girl, Morty realizes that he does not need a girlfriend, what he needs is to study programming. He already understands the basics of C programming but is struggling to understand pointers.

To help him understand better, Morty decides to practice making functions to change values of 2 malloced arrays. The functions he made are:

Swap, which takes in 2 characters and 2 integers and uses them for coordinates for the integers that needs to be swapped. (A B 1 2 means to swap the values of A[1] and B[2])  

Switch, swaps all the values of array A and array B

Replace, which takes in 1 character and 2 integers, the first 2 are used for coordinates whereas the last integer is used for the new value.(A 1 100 means replace the value of A[1] to 100)

Stop, which stops the program and prints out the contents of both arrays.

Once Morty finishes this program suddenly the girl he rejected changed her mind, so in order to help you get a girlfriend/boyfriend, Morty wants you to make this program.

This is a partial judge program.

Input

integer M, the size of both arrays

M*2 number of integers which are the values of both arrays

A number of Commands:

Swap (2 characters and 2 integers)

Switch

Replace (1 character and 2 integers)

Stop (Stop the program and print the arrays)

 

Output

The contents of both arrays followed by a newline

Sample Input  Download

Sample Output  Download

Partial Judge Code

13372.c

Partial Judge Header

13372.h

Tags




Discuss




13743 - Grades   

Description

Bojack has a list of names from the programming class. He needs to sort the list from the best grades to the lowest in order to know the best and worst student in the class. Help the Bojack to sort the grades! Note that everyone has a unique name, so if they have the same grades, sort it from Z to A. (Not A to Z!)

This is a partial judge program.

Input

The first line consists of an integer n

For the next n line, each line consists of an integer m and string s, representing the grade and name of the student

< n,m < 1000

< < 50

Output

The lists of students name in descending order.

Sample Input  Download

Sample Output  Download

Partial Judge Code

13743.c

Partial Judge Header

13743.h

Tags




Discuss




13745 - Matrix tros   

Description

Sort m numbers in ascending order, where m = n2 into an nxn matrix.

This is a partial judge program.

Input

First line is an integer m 

m = n2

Output

n x n sorted matrix

Sample Input  Download

Sample Output  Download

Partial Judge Code

13745.c

Partial Judge Header

13745.h

Tags




Discuss




13749 - Brokenotkeyboardot   

Description

Noosik's friend Darwin has to submit an essay quickly but his keyboard is broken. For some reason, everytime he hits enter, it will type a string  instead. Help Noosik create a program for Darwin to split the essay.

Implement split string function and malloc a 2D array to store the splitted string and return it. Don't forget to free the memory space that was previously allocated. 

Hint: Be careful with the memory usage ! Dynamically allocate to avoid MLE

This is a partial judge program.

Input

The first line is a string s, that needs to be splitted.

The second line is a string z, that needs to be replaced.

20 < s < 500

< z < 10

Output

Output the strings splitted by followed by '\n' at the end of each splitted string.

Sample Input  Download

Sample Output  Download

Partial Judge Code

13749.c

Partial Judge Header

13749.h

Tags




Discuss