2196 - Huang_QUIZ2 Scoreboard

Time

2020/12/03 08:00:00 2020/12/03 10:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
13026 Third Largest Number
13027 Matrix Multiplication
13031 The Length Of The Longest Palindromic
13034 Huang Quiz Slides

13026 - Third Largest Number   

Description

Implement the C function find_third_largest() that finds the 3rd largest number of four numbers and store the result in the fifth argument. The prototype for the function is as follows:


void find_third_largest(const int*num1, const int*num2, const int*num3, const int*num4, int* ptr_result);
 
Assume that the main function that calls this function looks like this:
 
int main() {    
    int num1, num2, num3, num4, third_largest;   
    scanf("%d %d %d %d", &num1, &num2, &num3, &num4);   
    find_third_largest(&num1, &num2, &num3, &num4, &third_largest);   
    printf("The 3rd largest element is %d\n", third_largest);    
    return 0;
}
 
You need to implement the function and submit it as follow:
 
void find_third_largest(const int* num1, const int* num2, const int* num3, const int* num4, int* ptr_result){
...
...
}

Input

A list of four integers.

Output

"The 3rd largest element is X\n"

Sample Input  Download

Sample Output  Download

Partial Judge Code

13026.c

Partial Judge Header

13026.h

Tags




Discuss




13027 - Matrix Multiplication   

Description

If A is an m × n matrix and B is an n × p matrix,

the matrix product C = AB (denoted without multiplication signs or dots) is defined to be the m × p matrix

 

such that

Compute C = A × B, where AB and C are matrices of size n × mm × p, and n × p, respectivily.

 

Implement the matrix multiplication function matrix_mult(). The code is attached to the problem below.

 

All you need to submit are

 

void matrix_mult(int *const *const matrixA, int rows_A, int cols_A, int *const *const matrixB, int rows_B, int cols_B, int *const *const matrixC)

{   

/* TODO: Your Code here */

}

Reference code (13027.c) for this question is at the very bottom of this page under Partial Judge Code heading.

Input

n, m, where n is row and m is column.

Followed by matrix A elements.

 

m, p, where m is row and p is column.

Followed by matrix B elements.

Output

Matrix C elements.

Sample Input  Download

Sample Output  Download

Partial Judge Code

13027.c

Partial Judge Header

13027.h

Tags




Discuss




13031 - The Length Of The Longest Palindromic   

Description

 

  • A palindrome is a word like “deed” or “level”, which remains the same when you spell it backward.

  • We assume that the input string terminates with a period '.' and the length of input string is less than 100.

  • Implementing the function int maxlength_palindrom(char input[], int length)​ that finds the length of the longest palindromic substring of the input string.

 

All you need to submit are:

 

int maxlength_palindrom(char input[], int length)

{

/* TODO: Your Code here */

} 

Reference code for this question is at the very bottom of this page under Partial Judge Code heading.

Input

String of characters that terminates with a period '.'

Output

The length of the longest palindromic substring of the input string.

Sample Input  Download

Sample Output  Download

Partial Judge Code

13031.c

Partial Judge Header

13031.h

Tags




Discuss




13034 - Huang Quiz Slides   

Description

https://www.ee.nthu.edu.tw/chhuang/slides/Lec01.ppt

https://www.ee.nthu.edu.tw/chhuang/slides/Lec02.ppt

https://www.ee.nthu.edu.tw/chhuang/slides/Lec03.ppt

https://www.ee.nthu.edu.tw/chhuang/slides/Lec04.ppt

https://www.ee.nthu.edu.tw/chhuang/slides/Lec05.ppt

https://www.ee.nthu.edu.tw/chhuang/slides/Lec06.ppt

https://www.ee.nthu.edu.tw/chhuang/slides/Lec07.ppt

https://www.ee.nthu.edu.tw/chhuang/slides/Lec08.ppt

https://www.ee.nthu.edu.tw/chhuang/slides/Lec09.ppt

https://www.ee.nthu.edu.tw/chhuang/slides/scope.ppt

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss