SHARE
TWEET

croce

MaxDvc Dec 9th, 2019 (edited) 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def croce(A,i,j):
  2. #@param:
  3. #   A: matrix mxn;
  4. #   i: int, row index;
  5. #   j: int, column index;
  6. #   return: bool;
  7.     if i-1>=0:
  8.         if A[i-1][j]>=A[i][j]:
  9.             return False
  10.     if i+1<len(A):
  11.         if A[i-1][j]>=A[i][j]:
  12.             return False
  13.     if j-1>=0:
  14.         if A[i][j-1]>=A[i][j]:
  15.             return False
  16.     if j+1<len(A[i]):
  17.         if A[i][j+1]>=A[i][j]:
  18.             return False
  19.     return True
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top