#P3692. 夏幻的考试
夏幻的考试
Description
A university's Software Engineering program is holding a written test. Students fill answers on a machine-readable answer sheet. The school assigned the recognition task to Xia Huan, but the system requirements are too complex and she also has other projects to work on, so she wants you to help implement part of the functionality.
The paper has two parts: the header and single-choice questions.
Xia Huan has already written the recognition program, so the header and answers will be provided directly as numeric information. You need to implement the following features:
You need to process papers and check the following items in order.
- Check whether the examinee ID is filled in correctly.
Input format: One line: a 16-bit unsigned binary number id. The examinee's ID is id, and the correct ID range in decimal is .
If the ID is invalid, output one line Wrong ID and stop processing this paper (you still need to read the remaining two parts' input for this paper, but do not output anything else). If the ID is valid, output one line: ID: + an integer, which is the decimal form of the ID.
You do not need to consider whether IDs are duplicated; as long as the value is within the range, it is considered valid.
- Check whether the paper type is filled in correctly.
Input format: One line: two digits with no separator, each must be or . The first digit indicates whether paper type A is bubbled ( means not bubbled, means bubbled), and the second digit indicates whether paper type B is bubbled. In fact, the paper type can be determined by the last bit of the binary ID: means type A, means type B. You only need to check whether the student filled it correctly.
If the student filled the paper type correctly (bubbled, and only bubbled, the correct one), output one line Type Correct; otherwise, output one line Type Incorrect. Regardless of correctness, you must continue processing this paper.
- Score the single-choice questions.
The number of single-choice questions and the answer key will be provided before entering the first paper.
Candidate answers input format: lines, each with 4 digits and no separator. Each digit is or .
In order, they represent whether are bubbled ( means not bubbled, means bubbled). A student's answer to a question is correct if and only if the correct option is bubbled and all incorrect options are not bubbled.
Output one line: a floating-point number rounded to 1 decimal place, representing the student's score. The full score is , and each question has the same weight.
Input Format
The first line contains two integers and , separated by a space, as described above.
The next line contains a string of length . Each character is one of the uppercase letters , and the -th character is the answer to single-choice question .
Then the next lines contain groups of information, representing the content of each paper, with the format as described above.
Output Format
For each paper, output the judgment results as described. Insert one blank line between the results of two papers.
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
3 3
ABC
0000000000000000
01
1111
0001
0100
0000000000000010
10
1000
0100
0010
0000000000000011
11
0001
0000
0010
Wrong ID
ID: 2
Type Correct
100.0
ID: 3
Type Incorrect
33.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
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
Hint
For 100% of the testdata
Notes:
- Please also add a newline after processing the last paper.
- Due to differences in line endings between Windows and Linux, it is recommended not to use scanf to read char.
Translated by ChatGPT 5
京公网安备 11011102002149号