SPOJ Galadriel的镜子(运行时错误)

时间:2014-07-07 18:43:01

标签: python-2.7

我正在尝试解决http://www.spoj.com/problems/AMR12D/但我一次又一次地遇到运行时错误NZEC。 这是我的代码:

t=input()
while t:
    s=raw_input("")
    j=s[::-1]
    if j==s:
        print "YES"
else:
        print "NO"
t=t-1;

你能告诉我NZEC错误背后的原因吗?

1 个答案:

答案 0 :(得分:0)

根据网站上的例子建议:

t=int(raw_input()) # first line of input is the number of cases
while t:
    s=raw_input() # read another string
    j=s[::-1]
    if j==s:
        print "YES"
else:
        print "NO"
t=t-1;