My solution works on my computer and on ideone.com
But it is giving a NZEC error here on SPOJ. I'm using Python 3.5.2.
t=int(input())
l=[]
c=[]
s=[]
for x in range(t):
i1=input()
ll,cc,ss=i1.split(" ")
l.append(int(ll))
c.append(int(cc))
s.append(int(ss))
for x in range(t):
for y in range(l[x]*(s[x]+1)+1):
ss=""
for z in range(c[x]*(s[x]+1)+1):
rev=c[x]*(s[x]+1)
sat=y//(s[x]+1)
sut=z//(s[x]+1)
if y==0 or y%(s[x]+1)==0 or z==0 or z%(s[x]+1)==0:
ss=ss+"*"
elif y%(s[x]+1)==z%(s[x]+1) and (sat+sut)%2==0:
ss=ss+"\\"
elif y%(s[x]+1)==(rev-z)%((s[x]+1)) and (sat+sut)%2==1:
ss=ss+"/"
else:
ss=ss+"."
print(ss)
print()
created
last reply
- 4
replies
- 910
views
- 2
users
- 1
like