annoying NZEC error

here’s my code for the alien chef practice problem… it seems to work fine on my machine but gives a runtime NZEC error on codechef compiler… please help

n=int(raw_input())
    n=int(raw_input())
s=[0]
e=[0]
for i in range(1,n+1):
    s=s + [int(raw_input())]
    e=e + [int(raw_input())]
q=int(raw_input())
for p in range(q):
    j=int(raw_input())
    count=0
    t=[0]
    for m in range(1,j+1):
        t=t+[int(raw_input())]
    for i in range(1,n+1):
        flag=0
        for z in range(1,m+1):
            if t[z]>=s[i] and t[z]<=e[i]:
                flag=1
        if flag==1:
            count+=1
    print count

I guess it won’t work for sample testcase too.Because once observe this part :

s=s + [int(raw_input())]

Using raw_input() you are scanning “S_i E_i”.Space is present in between S_i and E_i.So when ever you try to make it as int you can get Runtime error.Use raw_input().split(’ ') instead.
My approach is :

temp_s,temp_e=raw_input().split(’ ').
After this you have S_i in temp_s and E_i in temp_e.
Now you can use :

s=s+int(temp_s)

e=e+int(temp_e)

Try to change remaining part of your code too.

For reference :

http://stackoverflow.com/questions/1397827/how-to-read-formatted-input-in-python

http://echorand.me/2012/10/11/input-and-raw_input-in-python/

//