81
правка
Изменения
м
sumXoperationX(vertexX, leftBorderXleftX, rightBorderXrightX, leftXneedLeftX, rightXneedRightX, leftYneedLeftY, rightYneedRightY, t[][])
sumYoperationY(vertexX, vertexY, leftBorderYleftY, rightBorderYrightY, leftYneedLeftY, rightYneedRightY)
tmy med = (leftBorderY leftY + rightBorderYrightY) / 2 return sumYoperationY(vertexX, vertexY * 2 + 1, leftBorderYleftY, tmymed, leftYneedLeftY, min(rightYneedRightY, tmymed), t) <tex>\times</tex> sumYoperationY(vertexX, vertexY * 2 + 2, tmy med + 1, rightBorderYrightY, max(leftYneedLeftY, tmy med + 1), rightYneedRightY, t)
изменены имена переменных
// first call - sumX(0, 0, n - 1, leftX, rightX, leftY, rightY, t)
if leftX > rightX
return 0
if leftX == leftBorderX needLeftX && rightX == rightBorderXneedRightX return sumYoperationY(vertexX, 0, 0, m - 1, leftYneedLeftY, rightYneedRightY) tmx med = (leftBorderX leftX + rightBorderXrightX) / 2 return sumXoperationX(vertexX * 2 + 1, leftBorderXleftX, tmxmed, leftX, min(rightXneedRightX, tmxmed), leftYneedLeftY, rightYneedRightY, t) <tex>\times</tex> sumXoperationX(vertexX * 2 + 2, tmx med + 1, rightBorderXrightX, max(leftXneedLeftX, tmx med + 1), rightXneedRightX, leftYneedLeftY, rightYneedRightY, t)
if leftY > rightY
return 0
if leftY == leftBorderY needLeftY && rightY == rightBorderYneedRightY
return t[vertexX][vertexY]
Обновление элемента: