still don't reach 668697

This commit is contained in:
basicbonobo 2024-01-05 01:58:40 +01:00
parent 923906a706
commit 7a50a1543a
1 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
from numba import jit
from useful import *
target = 64 if not len(sys.argv) > 1 else int(sys.argv[1])
@ -14,6 +15,7 @@ def cango(pos):
return pos[0] >= 0 and pos[1] >= 0 and pos[0] < h and pos[1] < w and \
kart[pos] != '#'
@jit
def cango2(pos):
global w, h
u, v = 0, 0
@ -48,7 +50,7 @@ def solve2(kart, pos, dist, os, oe):
global dmap2, target, q
if dist > target:
return
if dist >= dmap2[pos][os][oe]:
if dist >= dmap2[pos][os][oe] and win(dmap2[pos][os][oe]):
return
dmap2[pos][os][oe] = dist
for d in DIRS:
@ -57,11 +59,14 @@ def solve2(kart, pos, dist, os, oe):
if ok:
q += [(kart, realpos, dist + 1, os + u, oe + v), ]
def win(x):
return x % 2 == target % 2
def vectorable(x):
acc = 0
for sk in x:
for ek in x[sk]:
if x[sk][ek] % 2 == target % 2:
if win(x[sk][ek]):
acc += 1
return acc