Advertisement
Guest User

Untitled

a guest
May 9th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. L=[]
  2. for i in range(200):
  3. L.append(list(map(int,input().split())))
  4. print(L)
  5. print(len(L))
  6. sasiedzi=0
  7. for y in range(200):
  8. for x in range(320):
  9. pos=0
  10. if 0<x and abs(L[y][x]-L[y][x-1]) > 128: pos=1
  11. if x<319 and abs(L[y][x]-L[y][x+1]) > 128: pos=1
  12. if 0<y and abs(L[y][x]-L[y-1][x]) > 128: pos=1
  13. if y <199 and abs(L[y][x]-L[y+1][x]) > 128: pos=1
  14. sasiedzi+=pos
  15. print(sasiedzi)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement