ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1196. History Exam

Al Alamin WA #8 time limit exceeded [1] // Problem 1196. History Exam 9 May 2013 12:20
Does any one have a faster code of python than this

p=int(input())
plist=set()
for i in range (p):
    a=int(input())
    plist.add(a)

s=int(input())
slist=[]
count=0
for i in range (s):
    a=int(input())
    if a in plist:
        count+=1
print (count)


naugrim Re: WA #8 time limit exceeded // Problem 1196. History Exam 21 Jan 2015 03:54
I've no idea how to make it faster. Got stuck myself.