Skip to content

Commit 58f437e

Browse files
committed
Auto-sync: 2026-02-25 15:22:31
1 parent 049da2a commit 58f437e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

2000D.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,19 @@ void MASTER(){
3232
while(l<r){
3333
if(s[l] == 'L' && s[r] == 'R'){
3434
sum += pref[r] - pref[l];
35+
l++;
36+
r--;
3537
}
36-
else if(s[l] != 'L'){
37-
l--;
38+
else {
39+
if(s[l] != 'L'){
40+
l++;
3841
}
39-
else if(s[r] !='R'){
42+
if(s[r] !='R'){
4043
r--;
4144
}
45+
}
4246
}
47+
cout << sum << nl;
4348

4449

4550

0 commit comments

Comments
 (0)