P5266 [Deep Basics 17.Example 6] Student Record Management

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 $10^5$ operations in total): - Insert and update, format `1 NAME SCORE`: Insert a student whose name is $\texttt{NAME}$ (a case-sensitive string consisting of letters and digits, with at most $20$ characters) and whose score is $\texttt{SCORE}$ ($0

Input Format

The first line contains a positive integer $Q$ ($1 \le Q \le 10^5$), which indicates the number of operations. In the next $Q$ lines, each line first contains a positive integer $op$ ($op \in [1,4]$), which indicates the type of operation. Then: - If $op = 1$, input an additional string $\texttt{NAME}$ and a positive integer $\texttt{SCORE}$, with meanings as described above. - If $op = 2$, input an additional string $\texttt{NAME}$, with meaning as described above. - If $op = 3$, input an additional string $\texttt{NAME}$, with meaning as described above. - If $op = 4$, no additional input is needed.

Output Format

Output a total of $Q$ 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.

Explanation/Hint

Translated by ChatGPT 5