Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check(pict, k):
- # @param pict : picture
- # @param k : int
- # @return bool
- width=getWidth(pict)
- height=getHeight(pict)
- return exist(pict, width, height, k)
- def checkRow(pict, D1, y, k):
- # @param pict : Picture
- # @param D1: int (width)
- # @param y: pixel (height)
- # @param k : int
- # @return bool
- r=0
- for x in range(0, D1):
- px=getPixel(pict, x, y)
- r=r+getRed(px)
- return r == k
- def exist(pict, D1, D2, k) :
- # @param pict : Picture
- # @param D1 : int (width)
- # @param D2 : int (height)
- # @param k : int
- # @return bool
- for y in range(0, D2):
- if checkRow(pict, D1, y, k) == True :
- return True
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement