IBMOA #11
Cache Query Handler
估计简单可在线判题
考点(AI 标注)哈希计数
Each cache entry contains a time, a key and an integer value in string form; each query gives a key and an exact time. Every queried entry is guaranteed to exist, and no key repeats at the same time. Return the corresponding original value string; do not look up the nearest time.
输入格式
The first line contains n q, followed by n lines of time key value, and finally q lines of key time. 1≤n,q≤100000; times are valid hh:mm:ss; values represent 1..10^8. The source does not limit the text length of keys or values; on this site keys are 1..64 lowercase letters or digits, values are 1..64 decimal digits (leading 0 allowed), and the total input is ≤16MiB.
输出格式
Output the original value strings in query order.
样例 1
输入:
3 2
12:30:22 a 125
09:07:47 b 341
01:23:09 a 764
a 01:23:09
b 09:07:47
输出:
764 341
样例 2
输入:
1 1
00:00:00 a 0007
a 00:00:00
输出:
0007
样例 3
输入:
2 1
00:00:00 a 1
00:00:01 a 2
a 00:00:00
输出:
1
样例说明
The examples give 764 341; 0007; and 1 respectively; leading zeros in value strings are preserved.