You are viewing a single comment's thread. Return to all comments →
Obtained by observing pattern for small cases with following code
n,q=map(int,input().split())
a=[]
r=n
c=n
for i1 in range(r):
col=[] for j1 in range(c): if(((i1+1)*(j1+1))%7 in [2,3,4,5]): col.append('X') else: col.append('Y') a.append(col)
def anti90(l):
return(list(reversed(list(zip(*l)))))
for _ in range(q):
angle=int(input()) angle=angle%360 b=a.copy() count=0 if(angle%360==90): b=anti90(anti90(anti90(b))) elif(angle%360==180): b=anti90(anti90(b)) elif(angle%360==270): b=anti90(b) else: print(0) continue for i in range(r): for j in range(c): if(a[i][j] != b[i][j]): count+=1 print(count)
Seems like cookies are disabled on this browser, please enable them to open this website
Hackonacci Matrix Rotations
You are viewing a single comment's thread. Return to all comments →
Obtained by observing pattern for small cases with following code
n,q=map(int,input().split())
a=[]
r=n
c=n
for i1 in range(r):
def anti90(l):
for _ in range(q):