Skip to content

Commit dd71371

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 31de666 commit dd71371

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

solutions/gold/kilonova-ssdj.mdx

+15-5
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,17 @@ int main() {
6363
} else {
6464
lst[row][col] = lst[row - 1][col];
6565
}
66-
while (stackSize && lst[row - 1][col] >= lst[row][d[stackSize]]) { --stackSize; }
66+
while (stackSize &&
67+
lst[row - 1][col] >= lst[row][d[stackSize]]) {
68+
--stackSize;
69+
}
6770
if (mat[row][col] == i) {
6871
ans += stackSize;
6972
if (stackSize && d[1] == col) { --stackSize; }
7073
}
71-
while (stackSize && lst[row][col] >= lst[row][d[stackSize]]) { --stackSize; }
74+
while (stackSize && lst[row][col] >= lst[row][d[stackSize]]) {
75+
--stackSize;
76+
}
7277
if (lst[row][col] <= (row - 1) && lst[row][col] != 0) {
7378
d[++stackSize] = col;
7479
}
@@ -84,8 +89,11 @@ int main() {
8489
} else {
8590
lst2[row][col] = lst2[row + 1][col];
8691
}
87-
while (stackSize && lst2[row + 1][col] <= lst2[row][d[stackSize]]) {
88-
if (mat[lst2[row][d[stackSize]]][d[stackSize]] == i) { hm--; }
92+
while (stackSize &&
93+
lst2[row + 1][col] <= lst2[row][d[stackSize]]) {
94+
if (mat[lst2[row][d[stackSize]]][d[stackSize]] == i) {
95+
hm--;
96+
}
8997
stackSize--;
9098
}
9199
if (mat[row][col] == i) {
@@ -94,7 +102,9 @@ int main() {
94102
if (stackSize && d[stackSize] == col) { ans--; }
95103
}
96104
while (stackSize && lst2[row][col] <= lst2[row][d[stackSize]]) {
97-
if (mat[lst2[row][d[stackSize]]][d[stackSize]] == i) { hm--; }
105+
if (mat[lst2[row][d[stackSize]]][d[stackSize]] == i) {
106+
hm--;
107+
}
98108
stackSize--;
99109
}
100110
if (lst2[row][col] >= (row + 1) && lst2[row][col] != (n + 2)) {

0 commit comments

Comments
 (0)