1
class SubrectangleQueries {
2
public:
3
vector<vector<int>> rect;
4
SubrectangleQueries(vector<vector<int>> &rectangle) {
5
rect = rectangle;
6
}
7

8
void updateSubrectangle(int row1, int col1, int row2, int col2, int newValue) {
9
for (int i = row1; i <= row2; ++i) {
10
for (int j = col1; j <= col2; ++j) {
11
rect[i][j] = newValue;
12
}
13
}
14
}
15

16
int getValue(int row, int col) {
17
return rect[row][col];
18
}
19
};

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0