• + 1 comment

    """ This is my submission in Python, it's not runnning within time limits, can someone help? """

    import re

    phoneBook = {} if name == 'main': n = int(input().strip()) for i in range(n): match = re.match(r'(\w+)\s+(\d+)', input().strip()) phoneBook[match.group(1)] = match.group(2)

    def queryPhoneBook(name): if name in list(phoneBook.keys()): print(f'{name}={phoneBook[name]}') else: print('Not found')

    try: go = True while go: q = input().strip() if len(q)>0: queryPhoneBook(q) else: break except EOFError: pass