Time Limit!!! for UVa 11340 Newspaper
Difference between en3 and en4, changed 2 character(s)
Please help me to overcome time limit.↵

Problem Link: [UVa 11340 Newspaper](https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2315)↵

My Code:↵

~~~~~↵
from sys import stdin,stdout↵
dd = dict()↵
tests = int(input().strip() )↵
for t in range(tests):↵
    dd.clear()↵
    sm = 0.0↵
    m = int(input().strip())↵
    for x in range(m):↵
        ch,vl = input().strip().split()↵
        dd[ch]=float(vl)↵
    for x in range(int(input())):↵
        line=input()↵
        for letter in line:↵
            if letter in dd:↵
                sm += dd[letter]↵
    print('%0.2f$' %(sm/100.0))↵
~~~~~↵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Ishtiaq11 2016-07-20 18:26:00 2
en3 English Ishtiaq11 2016-07-20 18:25:06 28
en2 English Ishtiaq11 2016-07-20 17:55:03 27 (published)
en1 English Ishtiaq11 2016-07-20 17:53:40 685 Initial revision (saved to drafts)