11496 - MAP Test   

Description

Notice, first and last is [first, last].

The following references will help you understand how to use functions in std::map.

Input

The input consists of a series of commands. A command can be an insert or range erase.

insert: inserts a string (cmd) with the key (key) to map. If the key has already existed, insert the cmd at the begining of string (the string which the key belongs).

For example,

insert 0 "abc"

insert 1 "def"

the map should contain "abc", "def".

insert 0 "xyz"

the map should contain "xyzabc", "def".

range erase: erase the strings from key (first) to key (last).

operator<<: outputs all strings in map. From the smallest key to biggest key. Output a space character (' ') after printing an element.

Output

Complete insert, erase and operator<<.

Sample Input  Download

Sample Output  Download

Partial Judge Code

11496.cpp

Partial Judge Header

11496.h

Tags




Discuss