fenwick_2d
Maintains a 2D grid for point updates and rectangle sum queries, enabling cumulative-sum lookups across rows and columns.
Instructions
2D Fenwick tree for point updates and rectangle sum queries.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"rows": "<rows>",
"cols": "<cols>",
"operations": "<operations>"
},
"name": "fenwick_2d"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cols | Yes | Number of columns | |
| rows | Yes | Number of rows | |
| operations | Yes | Array of {type, row, col, row2?, col2?, value?} operations |