File tree 1 file changed +15
-5
lines changed
1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,17 @@ int main() {
63
63
} else {
64
64
lst[row ][col ] = lst[row - 1 ][col ];
65
65
}
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
+ }
67
70
if (mat[row ][col ] == i) {
68
71
ans += stackSize;
69
72
if (stackSize && d[1 ] == col) { --stackSize; }
70
73
}
71
- while (stackSize && lst[row ][col ] >= lst[row ][d [stackSize ]]) { --stackSize; }
74
+ while (stackSize && lst[row ][col ] >= lst[row ][d [stackSize ]]) {
75
+ --stackSize;
76
+ }
72
77
if (lst[row ][col ] <= (row - 1 ) && lst [row ][col ] != 0 ) {
73
78
d [++ stackSize ] = col ;
74
79
}
@@ -84,8 +89,11 @@ int main() {
84
89
} else {
85
90
lst2 [row ][col ] = lst2 [row + 1 ][col ];
86
91
}
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
+ }
89
97
stackSize -- ;
90
98
}
91
99
if (mat [row ][col ] == i ) {
@@ -94,7 +102,9 @@ int main() {
94
102
if (stackSize && d [stackSize ] == col ) { ans -- ; }
95
103
}
96
104
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
+ }
98
108
stackSize -- ;
99
109
}
100
110
if (lst2 [row ][col ] >= (row + 1 ) && lst2 [row ][col ] != (n + 2 )) {
You can’t perform that action at this time.
0 commit comments