hiho week 239 register

Ended

Participants:101

Verdict:Accepted
Score:100 / 100
Submitted:2019-01-26 22:59:07

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <cstdio>
#include <iostream>
using namespace std;
int len;
string read;
char c;
int main()
{
    int cas;
    scanf("%d",&cas);
    while(cas--)
    {
        cin>>read;
        int a=0,t=0;
        len=read.size();
        for(int i=0; i<len; i++)
        {
            c=read[i];
            if(c=='A')a++;
            if(c=='L')t++;
            else t=0;
            if(a>1)break;
            if(t>2)break;
        }
        if(a>1)puts("NO");
        else if(t>2)puts("NO");
        else puts("YES");
    }
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX