12504 - Updating a Dictionary
来源:互联网 发布:强制竖屏软件 编辑:程序博客网 时间:2024/05/29 15:56
In this problem, a dictionary is collectionof key-value pairs, where keys are lower-case letters, and values arenon-negative integers. Given an old dictionary and a new dictionary, find outwhat were changed.
Each dictionary is formatting as follows:
{key:value,key:value,...,key:value}
Each key is a string of lower-case letters,and each value is a non-negative integer without leading zeros or prefix `+'.(i.e. -4, 03 and +77 are illegal). Each key will appear at most once, but keyscan appear in any order.
Input
The first line contains the number of testcases T ( T1000). Each test casecontains two lines. The first line contains the old dictionary, and the secondline contains the new dictionary. Each line will contain at most 100 charactersand will not contain any whitespace characters. Both dictionaries could beempty.
WARNING: there are no restrictions on the lengths of each key and value inthe dictionary. That means keys could be really long and values could be reallylarge.
Output
For each test case, print the changes,formatted as follows:
- First, if there are any new keys, print `+' and then the new keys in increasing order (lexicographically), separated by commas.
- Second, if there are any removed keys, print `-' and then the removed keys in increasing order (lexicographically), separated by commas.
- Last, if there are any keys with changed value, print `*' and then these keys in increasing order (lexicographically), separated by commas.
If the two dictionaries are identical,print `No changes' (without quotes) instead.
Print a blank line after each test case.
SampleInput
3
{a:3,b:4,c:10,f:6}
{a:3,c:5,d:10,ee:4}
{x:1,xyz:123456789123456789123456789}
{xyz:123456789123456789123456789,x:1}
{first:1,second:2,third:3}
{third:3,second:2}
SampleOutput
+d,ee
-b,f
*c
No changes
-first
- 12504 - Updating a Dictionary
- 12504 - Updating a Dictionary
- 12504 - Updating a Dictionary
- UVA - 12504 Updating a Dictionary
- UVa 12504 - Updating a Dictionary
- UVA - 12504 Updating a Dictionary
- Uva - 12504 - Updating a Dictionary
- UVA 12504 Updating a Dictionary
- *UVa 12504 - Updating a Dictionary
- UVA 12504-Updating a Dictionary
- UVa 12504 Updating a Dictionary
- uva 12504 Updating a Dictionary
- UVA 12504 Updating a Dictionary
- uva 12504 Updating a Dictionary
- UVa 12504 - Updating a Dictionary(数据处理)
- UVa 12504 Updating a Dictionary(更新字典)
- Uva 12504-Updating a Dictionary(STL, map)
- uva 12504 Updating a Dictionary(更新字典)
- [CODEVS 3044] 矩形面积求并
- 10935 - Throwing cards away I
- 12100—Printer Queue
- 12333 - Revenge of Fibonacci
- Eclipse + JLink 编译和调试TQ2440裸机程序【我使用的是win64版本的eclipse】
- 12504 - Updating a Dictionary
- Matrix Chain Multiplication-geeksforgeeks
- nodejs的字符串操作模块
- Android事件处理之处理键盘事件
- OC语言——基本语法和思想
- Ubuntu 14.04安装搜狗输入法
- 单词匹配
- L先生第二天
- shell的简介