12255 - Student list   

Description

A teacher creates a list to store students' information. Inside this list, each student's name and ID are recorded.

Please write a program to help the teacher.

The program are required to support following features:

  1. Show all the names in the list.
  2. Show all the IDs in the list.
  3. Add a student to the end of the list.
  4. Duplicate a student's info, and append to the end of list.
  5. Delete an entry from list.

Note that there could be multiple same records in the list.

*To this program works normally, please use C++11 or above for compilation.

Input

First line of input contains an integer K (K < 100).

Each of the following K lines is an operation. Operations will be one of the following form:

  1. "0": show all names in the list
  2. "1": show all IDs in the list
  3. "2 <name> <id>": add a student with name=<name> and id=<id> to the end of the list. The length of name is less than 100, and the length of id is less than 10.
  4. "3 <idx>": duplicate the information of idx-th entry in the list (append the duplicated information to the end of the list).
  5. "4 <idx>": remove the information of idx-th entry in the list.

*All the input processing have been handled by the provided code.

Output

For operation 0 and 1, print out the corresponding information.

Sample Input  Download

Sample Output  Download

Partial Judge Code

12255.cpp

Partial Judge Header

12255.h

Tags




Discuss