#P5266. 【深基17.例6】学籍管理
【深基17.例6】学籍管理
Problem Description
You need to design a student record management system. At the beginning, the student record data is empty. Then the system must support the following operations (no more than operations in total):
- Insert and update, format
1 NAME SCORE: Insert a student whose name is (a case-sensitive string consisting of letters and digits, with at most characters) and whose score is (). If a student with the same name already exists, update this student's score to . If the insertion or update succeeds, outputOK. - Query, format
2 NAME: Query the score of the student whose name is . If the student cannot be found, outputNot found; otherwise, output the student's score. - Delete, format
3 NAME: Delete the information of the student whose name is . If the student cannot be found, outputNot found; otherwise, outputDeleted successfully. - Summary, format
4: Output the number of students in the system.
Input Format
The first line contains a positive integer (), which indicates the number of operations.
In the next lines, each line first contains a positive integer (), which indicates the type of operation. Then:
- If , input an additional string and a positive integer , with meanings as described above.
- If , input an additional string , with meaning as described above.
- If , input an additional string , with meaning as described above.
- If , no additional input is needed.
Output Format
Output a total of lines. Each line outputs a string or a positive integer, which is the processing result of the corresponding operation. The exact meaning is as described above.
5
1 lxl 10
2 lxl
3 lxl
2 lxl
4
OK
10
Deleted successfully
Not found
0
Hint
Translated by ChatGPT 5