Skip to main content
deleted 1 character in body
Source Link
lynn
  • 69.2k
  • 11
  • 133
  • 283

Python 2, 208 184 169 167 164163 bytes

w,h=input()
def f(x):global p;a=p;p&=~2**x;a>p>[xg;o=g;g&=~2**x;o>g>[x/w==(x+qx+s)/w<f(x+qx+s)or-1<x/w+q<h<fw+s<h<f(x+q*wx+s*w)for qs in[-1,1]]
i=k=1<<w*hn=i=1<<w*h
while ki:p=k=kg=i=i-1;f(len(bin(pg))-3);i;n-=p>0=g>0
print iprint~-1n

Python 2, 208 184 169 167 164 bytes

w,h=input()
def f(x):global p;a=p;p&=~2**x;a>p>[x/w==(x+q)/w<f(x+q)or-1<x/w+q<h<f(x+q*w)for q in[-1,1]]
i=k=1<<w*h
while k:p=k=k-1;f(len(bin(p))-3);i-=p>0
print i-1

Python 2, 208 184 169 167 163 bytes

w,h=input()
def f(x):global g;o=g;g&=~2**x;o>g>[x/w==(x+s)/w<f(x+s)or-1<x/w+s<h<f(x+s*w)for s in[-1,1]]
n=i=1<<w*h
while i:g=i=i-1;f(len(bin(g))-3);n-=g>0
print~-n
deleted 3 characters in body
Source Link
lynn
  • 69.2k
  • 11
  • 133
  • 283

Python 2, 208 184 169 167167 164 bytes

w,h=input()
def f(x):global p;a=p;p&=~2**x;a>p>[x/w==(x+q)/w<f(x+q)or-1<x/w+q<h<f(x+q*w)for q in[-1,1]]
i=k=0i=k=1<<w*h
exec"p=k=k+1;fwhile k:p=k=k-1;f(len(bin(p))-3);i+=p<1;"*~;i-(1<<w*h)=p>0
print i-1

Python 2, 208 184 169 167 bytes

w,h=input()
def f(x):global p;a=p;p&=~2**x;a>p>[x/w==(x+q)/w<f(x+q)or-1<x/w+q<h<f(x+q*w)for q in[-1,1]]
i=k=0
exec"p=k=k+1;f(len(bin(p))-3);i+=p<1;"*~-(1<<w*h)
print i

Python 2, 208 184 169 167 164 bytes

w,h=input()
def f(x):global p;a=p;p&=~2**x;a>p>[x/w==(x+q)/w<f(x+q)or-1<x/w+q<h<f(x+q*w)for q in[-1,1]]
i=k=1<<w*h
while k:p=k=k-1;f(len(bin(p))-3);i-=p>0
print i-1
added 9 characters in body
Source Link
lynn
  • 69.2k
  • 11
  • 133
  • 283

Python 2, 208 184 169169 167 bytes

w,h=input()
def f(x):global p;a=p&2**x;p^=a;a and[xp;a=p;p&=~2**x;a>p>[x/w==(x+q)/w<f(x+q)or-1<x/w+q<h<f(x+q*w)for q in[-1,1]]
i=k=0
exec"p=k=k+1;f(len(bin(p))-3);i+=p<1;"*~-(1<<w*h)
print i

Python 2, 208 184 169 bytes

w,h=input()
def f(x):global p;a=p&2**x;p^=a;a and[x/w==(x+q)/w<f(x+q)or-1<x/w+q<h<f(x+q*w)for q in[-1,1]]
i=k=0
exec"p=k=k+1;f(len(bin(p))-3);i+=p<1;"*~-(1<<w*h)
print i

Python 2, 208 184 169 167 bytes

w,h=input()
def f(x):global p;a=p;p&=~2**x;a>p>[x/w==(x+q)/w<f(x+q)or-1<x/w+q<h<f(x+q*w)for q in[-1,1]]
i=k=0
exec"p=k=k+1;f(len(bin(p))-3);i+=p<1;"*~-(1<<w*h)
print i
deleted 8 characters in body
Source Link
lynn
  • 69.2k
  • 11
  • 133
  • 283
Loading
deleted 13 characters in body
Source Link
lynn
  • 69.2k
  • 11
  • 133
  • 283
Loading
Source Link
lynn
  • 69.2k
  • 11
  • 133
  • 283
Loading