P28312 [洛谷] Summer's Exam
普及
题目描述

Problem Background

Summer is a top student in the Software Engineering Department, and the school has entrusted her with the task of organizing an exam.

Problem Description

A university's Software Engineering program is holding a written exam where students fill in their answers on machine-readable answer sheets. The school has assigned the task of reading these sheets to Summer, but the system requirements are too complex, and she has other projects to work on, so she wants you to help implement some of the functionalities.

The exam paper consists of a header and multiple-choice questions.

Summer has already written the recognition program, so the header and answers will be presented to you in digital form. You need to implement the following functionalities:

You need to process T exam papers and sequentially check the following options.

  1. Check if the exam number is filled in correctly.

Input format:

One line, a 16-bit unsigned binary number id. This represents the student's exam number as id, and the correct range in decimal is 1 to 10000.

If the exam number is incorrect, output one line "Wrong ID" and end the processing for this paper (the remaining two options' data should still be read in but not output anything), without quotes. If the exam number is correct, output one line, "ID: " + an integer, representing the exam number in decimal form, without quotes.

There is no need to consider whether the exam number is duplicated; as long as it is within the range, it is considered correct.

  1. Check if the paper type is correct.

Input format:

One line, two integers, with no separator, can only be 0 or 1. The first integer indicates whether paper type A is marked (0 means not marked, 1 means marked), and the second integer indicates whether paper type B is marked. The paper type can actually be determined by the last bit of the binary exam number, 0 means A, and 1 means B. You only need to check if the student has marked the correct one.

If the student has correctly marked the paper type (marked and only marked the correct one), output one line "Type Correct", otherwise output one line "Type Incorrect", without quotes. Regardless of whether the paper type is marked correctly, you still need to continue processing this paper.

  1. Grade the multiple-choice questions.

The number of multiple-choice questions n and the standard answers will be given before the first paper is entered.

Input format for student answers:

n lines, each line with 4 integers, with no separator. Each integer is 0 or 1.

In order, they represent whether A, B, C, D are marked (0 means not marked, 1 means marked). A student's answer is correct if and only if the position of the correct answer is marked and the positions of the incorrect answers are not marked.

Output one line, a floating-point number rounded to one decimal place, representing the student's score, with a maximum score of 100, and each question worth the same amount.

Input Format

The first line contains two integers T and n, separated by a space, with meanings as described in the problem.

The next line is a string s, of length n, where each character is one of the uppercase letters A, B, C, D, and the i-th character represents the answer to multiple-choice question i.

The next T*(n+2) lines contain T sets of information, representing the content of each exam paper, with the format as described in the problem.

Output Format

For each exam paper, output the evaluation results, with the format as described in the problem. Leave a blank line between the evaluation results of two exam papers.

Sample Input and Output

Input Sample #1

2 5
ABCAD
0000000011111111
01
1000
0010
0100
1000
0010
1001001001001001
01
0001
1010
0111
1111
0000

Output Sample #1

ID: 255
Type Correct
40.0

Wrong ID

Input Sample #2

3 3
ABC
0000000000000000
01
1111
0001
0100
0000000000000010
10
1000
0100
0010
0000000000000011
11
0001
0000
0010

Output Sample #2

Wrong ID

ID: 2
Type Correct
100.0

ID: 3
Type Incorrect
33.3

Input Sample #3

5 31
ACAACCDDBBDADDCBCACCDBCAACAAAAC
0000101111000001
10
1000
0010
1000
1111
0010
0010
0001
0001
0100
0100
0001
1000
0001
0001
0010
1111
0010
1000
0010
0010
0001
0100
1111
1000
1000
0010
1000
0100
1000
1000
0010
0000010101001111
10
1000
0010
1000
1000
0010
0010
0001
0001
0100
0100
0001
1000
0001
0001
0010
0100
1000
1000
0000
0010
0001
0100
0010
1000
1000
0010
1000
1000
0000
0000
0010
0001110001100110
11
1000
0010
1000
1000
0010
0010
0001
0001
0100
0100
0001
1000
0010
0100
0010
0100
0010
0100
0010
0010
0001
0100
0010
1000
1000
0010
1000
1111
1000
1000
0010
0001001111110001
10
1010
0010
1000
1000
0010
0010
0001
0001
0100
0100
0010
1000
0001
0001
0010
0100
0010
1000
0010
0010
0001
0100
0010
1000
1000
0010
1000
1000
1000
1000
0010
0001110010000100
10
1000
0010
1000
1000
0000
0010
0001
0001
0100
0100
0001
1000
0001
0001
0001
0100
0010
1000
0010
0010
0001
0100
0010
1000
1000
0010
1000
1000
0000
1000
0001

Output Sample #3

ID: 3009
Type Incorrect
87.1

ID: 1359
Type Incorrect
87.1

ID: 7270
Type Incorrect
87.1

ID: 5105
Type Incorrect
93.5

ID: 7300
Type Correct
87.1

Notes

For 100% of the data:

1 <= T <= 1000

1 <= n <= 50

Note:

  1. Please also add a newline after processing the last exam paper.

  2. Due to the differences in newline characters between Windows and Linux systems, it is recommended not to use scanf to read in characters.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2 5 ABCAD 0000000011111111 01 1000 0010 0100 1000 0010 1001001001001001 01 0001 1010 0111 1111 0000
样例输出
ID: 255 Type Correct 40.0 Wrong ID