def GetMinCalculateCount(self, sourceX, sourceY, targetX, targetY) : # write code here if sourceX>targetX&nbs***bsp;sourceY > targetY: return -1 if sourceX==targetX and sourceY != targetY: return -1 if sourceX != targetX and sourceY == targetY: return -1 count = 0 while 2*sourceX<=targetX and 2*sourceY<=targetY and targetX-1>0 and targetY-1>0: if targetX%2==0 and targetY%2 == 0: targetX /= 2 targetY /= 2 count += 1 else: targetX -= 1 targetY -= 1 count += 1 if targetX - sourceX != targetY - sourceY: return -1 count += targetX-sourceX return count 要py2才能100, py3是50, 差点被坑了