QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#855523#9925. LR StringMinami-373AC ✓335ms33416kbC++14951b2025-01-12 22:30:032025-01-12 22:30:10

Judging History

你现在查看的是最新测评结果

  • [2025-01-12 22:30:10]
  • 评测
  • 测评结果:AC
  • 用时:335ms
  • 内存:33416kb
  • [2025-01-12 22:30:03]
  • 提交

answer

#include<bits/stdc++.h>
#include<regex>
using namespace std;
const int N = 1e4 + 10;

int main() {
	int T;
	cin >> T;
	while (T--)
	{
		string s;
		cin >> s;
		int lens = s.size();
		int n;
		cin >> n;
		vector <vector<int>> v(lens + 1, vector<int>(2));
		int L = -1, R = -1;
		for (int i = lens; i >= 0; i--) {
			v[i][0] = L;
			v[i][1] = R;
			if (i != 0) {
				if (s[i - 1] == 'R') {
					R = i;
				}
				else L = i;
			}
		}
		while (n--)
		{
			string t;
			cin >> t;
			string a;
			if (s[0] != 'R' && t[0] == 'R') {
				cout << "NO" << endl;
				continue;
			}
			if (s[s.size() - 1] != 'L' && t[t.size() - 1] == 'L') {
				cout << "NO" << endl;
				continue;
			}
			int j = 0;
			for (int i = 0; i < t.size()&&j!=-1; i++) {
				if (t[i] == 'L')j = v[j][0];
				else j = v[j][1];
			}
			if (j == -1) {
				cout << "NO" << endl;
			}
			else {
				cout << "YES" << endl;
			}
		}
	}
}


这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3620kb

input:

2
RRLLRRLL
4
LLLLL
LLR
LRLR
R
RLLLLLL
3
LLLLL
RL
RRL

output:

NO
YES
NO
YES
YES
YES
NO

result:

ok 7 lines

Test #2:

score: 0
Accepted
time: 181ms
memory: 3620kb

input:

100000
RRLLR
4
R
R
R
R
LRLLL
6
R
L
L
L
L
R
RLLRR
1
L
LRLLL
3
R
L
L
RLRRL
2
LRRRR
RRRL
LRLRR
2
L
R
RRLRL
4
RLRLR
RLLL
LR
RLL
RLRLL
8
R
R
R
L
L
L
R
L
RLLRR
7
R
LL
RL
R
L
L
L
LLRLR
2
L
R
RRRRL
1
RLLLR
RRLLL
2
L
L
RLLRL
1
RLLRL
LRLLL
5
RLRLL
RLLLR
RRRRL
LLRRR
RLLRR
LRLLL
3
RRLL
R
RL
LLRRL
3
L
R
LLLRR
RR...

output:

YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO...

result:

ok 356450 lines

Test #3:

score: 0
Accepted
time: 271ms
memory: 31928kb

input:

2
RRLRLLLRLRLRLRLLLLRRLLLRLRRLLLLLLRRRRRLRLRLRLLLLRRRLLRLRRLLRRRRRLLRLLRLLLLRLLLLRLLRRRRLRLLRRLRRRLLRRRLLLRLLRRLRLRRRRLRRLRRRLRLRLLLRLRRLRLRRRRRRLRRRRRLLLRLLLLRLRRRLRLRLLLRLRLLLLRLRRLRRLLRLRLRRLLLRRRLLLLLLLRLRRLLLLLRLRRLRLRLRRRLLRLLRLLRRLRRLLRLRLRLRLRRLRRRLLLRLLRLRLRRLRRRLLRRRRRRRRLLRLLRRLLRRLLLLRLR...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
...

result:

ok 820231 lines

Test #4:

score: 0
Accepted
time: 212ms
memory: 32168kb

input:

2
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL...

output:

NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO...

result:

ok 531269 lines

Test #5:

score: 0
Accepted
time: 164ms
memory: 3860kb

input:

100000
LRLLLLRLRR
4
LLRRRRRR
LRLLL
LL
RLR
LLLLLRRLLR
1
RLLR
RRLRLRRRRR
1
LRLLLLRRLR
LRRLLRLRLL
3
RLRL
LLLRR
LRRLRRRL
RRRRLRLRRR
2
RRL
L
RRLLRRRLRL
4
LLLLRRRLRR
LRLLLRLRL
RRLRRLRLLR
RRRRRLLRLR
LLLLLRLLLR
1
LLRRLRLR
RLLLRLLRLL
1
RRLLRLRLLL
RLLRRLLLLL
6
L
L
L
R
R
L
LRLRLRRRRL
1
RLLRRRRRRL
RRLLLLLLRL
2
...

output:

NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
Y...

result:

ok 249969 lines

Test #6:

score: 0
Accepted
time: 283ms
memory: 3804kb

input:

100000
RRLLRRLLLR
1
L
RLLLLRRRRR
2
L
L
RLRRLLLRRL
3
L
L
R
LRLRLLRLLL
3
RRLLLLRLLL
L
RLRRLLLRRR
LLLRRLRRRL
4
L
R
L
L
RRLRLLLLLL
1
LLLL
RRLLRRLRLL
27
R
LR
L
R
R
LR
RLL
L
LR
L
L
LL
L
LL
R
R
R
LR
R
RL
LRLRL
L
L
LL
R
R
RRL
RLLRLRRRLL
4
L
LR
LRLRRLRR
R
LLLRRRRRRR
11
R
L
L
R
R
R
L
R
L
L
R
RLRLLLRLRL
8
LL
L...

output:

NO
NO
NO
YES
YES
YES
NO
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
Y...

result:

ok 527043 lines

Test #7:

score: 0
Accepted
time: 200ms
memory: 3632kb

input:

10000
RLLLRRLRLRLLRRLLLRRRRLLLLRRLLLRLRLLLLRRLRLRRLLLRLLLLLLLRLRRLRLLRRLLRRLLRRRLRRLRLRLLLLRRLLRLRRRLLRRLR
37
R
L
R
R
R
R
L
RL
R
R
RLL
R
RRLR
L
LR
R
LR
L
LL
R
LLLL
LRRR
R
LLL
L
LR
LR
RLR
LRRL
R
R
RRL
L
L
L
L
L
RRRRRRRLRLLLLLLLRRRLLLLRRLLRLLRLLRRRRLRLRRRRLRRLLLLLLRLLLLRRRRRRLLRRRLLRRRLLLRRRLRLLRLRRLL...

output:

YES
NO
YES
YES
YES
YES
NO
NO
YES
YES
NO
YES
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
NO
NO
YES
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
YES
NO
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
NO
NO
YES
YES
YES
YES
NO
NO
NO
NO
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES...

result:

ok 507876 lines

Test #8:

score: 0
Accepted
time: 219ms
memory: 3628kb

input:

1000
RLRLLLRLLLRRLRLLLRRLRLLLLLLLRLLLLRLRLRLRRLLLLLRRLLRRLRLLLRLRRLRRRLRRRLRLRLLRRRLRLLLRRRLRLRRRRRRLRRLRLLLLLLRRRLRLLRRRRRRLRLRLRLRRLRRLRRLRRRRRRRLLRRLRLLLLLRRRLLRLRRLLRLLLRLLRRLLRRLRLLLRRRLLLLRLLRRRRLRLRLRLRLRLRLRRLRLRLLLRRRLRLLRLLRRLRLLLRRRRRLRRLLLLRRLRRRLRLRLRRRLLRRLRRLLRRLRLRRLRLRRRLLRLRRLLRLLR...

output:

YES
YES
YES
NO
NO
NO
YES
YES
YES
NO
YES
NO
YES
NO
YES
NO
YES
NO
NO
NO
YES
NO
YES
NO
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
NO
YES
NO
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
YES
YES
NO
YES
NO
NO
YES
YES
NO
NO
...

result:

ok 515798 lines

Test #9:

score: 0
Accepted
time: 303ms
memory: 9192kb

input:

10
LRLLRLRRLLRRRLLRRRRLRLLLLRLRLLLRLRRRLLRLRLLLLRRLLLLRRRRRRRRLLLRLRLLLLLRLLRLRRRLRRRRRLRLRRLRLRRRRRLLLLRLRRRRLRLRLRRLRLLRLLRRRRLLRLRRLLRLLRLRLLLRRRRLLLRLLRRRRRLLLRLLLRLLLLLLRLRRLRLLLRRRLLLRLRLLRRLRLRRLRRLRLLLLLLLRRRLLRLLRRRRRRLLRRRRLRLLRLLRRLLRLRLLRRRLRRRRLRRRLRLRLRRLRLLLRLRRRRLLLRRLLRLRRRLRLLRRRRR...

output:

NO
YES
YES
NO
NO
YES
YES
NO
YES
YES
YES
YES
NO
NO
YES
NO
YES
NO
NO
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
NO
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
YES
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
NO...

result:

ok 779728 lines

Test #10:

score: 0
Accepted
time: 168ms
memory: 8988kb

input:

20
LRRRLLRLRLLLRLRLLRLLRRLLLLRRRRLLRLLLLLRLRLRLRLRLRRRLRRRLRLRLLRLRLRLRRLLRRRLLRRRRLRLLRLLRLRLRRLLRRLLRLRRLLRLLRRLLLRRLLLLLRLRRLLRRRLRRLLLLLLRLLRRRRRLLLLLLRLRLRRLLRRRRRRLRRLLLRRRRLLLLRLRRLRLLLRRLRLLRLRLLRRRRRRLRLLLLLRLLLLLRLRRLLLLLLLLRLLRRLRLLLRRRRLLLRLRLRRRLRRRLLRLRLLLRLRRLRLLLRRRLLLRLRLLRRRRLRLRLL...

output:

NO
YES
YES
NO
YES
NO
NO
NO
YES
NO
YES
YES
YES
NO
YES
YES
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
YES
YES
YES
NO
YES
NO
NO
YES
YES
NO
YES
NO
YES
...

result:

ok 447294 lines

Test #11:

score: 0
Accepted
time: 231ms
memory: 17780kb

input:

4
RRRRLLRRRRLLRLLLLRRLLLRLRLLLLRRRLLRRRRRRRLLLLRLRLRRLRLLLRLLLLRLRRLRRLRLRRRRLRLLLRLLLLLLLLLLLRRRLLLRRLRLRLRLRRLRLRRLLRRLRRRLLRLLRLRLRRLLRLLLLLLLRRRLLLLLRRLRRLLLRRRLRLLLLLLRLRRRRRLRLLRRLRRRRRLLRRRRLLLRRLLLRRRLLLLRLRRLRLLLLLRLLRLRLRRRLRRRRLLLLLLRRRRLRLRRRLRLLRRRLRRRRRRRRRRRLLRLRRRLRLLRLLRRRRRLRLLRRRL...

output:

YES
YES
NO
YES
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
YES
YES
YES
NO
YES
NO
YES
YES
NO
YES
YES
NO
NO
NO
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
NO
NO
YES
NO
YES
NO
NO
YES
YES
YES
YES
YES
NO
YES
NO
NO
YES
YES
YES
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
YES
YES
YES
YES
NO
NO
YES
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
...

result:

ok 508901 lines

Test #12:

score: 0
Accepted
time: 284ms
memory: 31532kb

input:

3
RLLRRRLRRLLLRLLRRRLLRLLLRRLLRRRLRLLRLLRLRRRRRLRLRLLLRLRLRRLRLLLRLLRRRRLLRLLRLRRRRLLLRLLLLRLLRRRLRRRRRRRLRLRRRLRRRLLLLRRLRLRLRLLRRRLLLLRRLRLRLLLRLRRRLLLLLLLLLRLRLLLRRLLRLLLRLRRLRLLRRLLLLLRRRRRRRLLRRRLRRRLLRRRRRRLRRRLLLRRRLLRLRLRRLLRLRLRRLRRLLRRRLRLLLLLLRLLLRRLLLRLRRRRLLRRRLLRRLRRRRLLLLRLLLLLRLRLLRR...

output:

NO
NO
NO
YES
YES
NO
NO
YES
NO
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
YES
N...

result:

ok 941609 lines

Test #13:

score: 0
Accepted
time: 335ms
memory: 31872kb

input:

2
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
...

result:

ok 858650 lines

Test #14:

score: 0
Accepted
time: 51ms
memory: 33380kb

input:

2
RRLLLLRRRLLLLLLRRRRLRRRRLLLLRRLRLLLRLLLLLRLLRLRLRRLLLRLRLLRRLRRRRLLLLRRRRLRLLRLRRRRRLRLRRLLLLRRRRLRRRRRRLRRLRLRLRLRRRRLLLRLLRLRLRRRLRLRRLRRRLLLRRLLLRRLLLRLLLRRRRLLRRRLLLRRLLLLRRLRRLLRLRLLRLRLLLRLLRRLRLRLLRRLRRLLRRLLLRLRRLLLRLRLRRRRRLRLRRLLRRLLLRLRRLRLRLRLRLRLRRLLRRLLLRLRRRRLRLLLRLRRRLLLRRLLLLRLRRR...

output:

NO
NO

result:

ok 2 lines

Test #15:

score: 0
Accepted
time: 51ms
memory: 32312kb

input:

2
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR...

output:

YES
YES
YES
YES
NO
NO
YES
YES
YES
NO

result:

ok 10 lines

Test #16:

score: 0
Accepted
time: 18ms
memory: 32004kb

input:

1
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL...

output:

NO
YES
YES
YES
NO

result:

ok 5 lines

Test #17:

score: 0
Accepted
time: 53ms
memory: 32376kb

input:

2
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL...

output:

YES
NO
NO
NO
YES
YES
YES
YES
YES
YES

result:

ok 10 lines

Test #18:

score: 0
Accepted
time: 35ms
memory: 31776kb

input:

1
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR...

output:

YES
YES
YES
NO
YES

result:

ok 5 lines

Test #19:

score: 0
Accepted
time: 51ms
memory: 33416kb

input:

2
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL...

output:

NO
YES

result:

ok 2 lines

Test #20:

score: 0
Accepted
time: 29ms
memory: 32540kb

input:

1
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL...

output:

YES

result:

ok single line: 'YES'

Extra Test:

score: 0
Extra Test Passed