#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
int dis, max_dis;
while (t--) {
max_dis = dis = 0;
string s;
cin >> s;
s = "R" + s + "R";
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'L') {
dis++;
} else if (s[i] == 'R') {
if (dis > max_dis) {
max_dis = dis;
}
dis = 0;
}
}
cout << max_dis + 1 << endl;
}
return 0;
}
机器人策略
最新推荐文章于 2024-02-27 10:13:02 发布