Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- string s, g = "0";
- cin >> s;
- for (int i = 1; i < n; i++) {
- if (s[i - 1] == 'R') {
- g += " " + to_string(i);
- } else {
- g = to_string(i) + " " + g;
- }
- }
- cout << g << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement