#include <iostream>
#include <string.h>
using namespace std;
int main()
{
int n;
string s;
while(cin >> n){
if(n == 0) break;
cin >> s;
if(n == 2){
cout << "N";
continue;
}
int t = 0;
for(int i = 1;i < n;i++){
if(s[i] == 'B'){
t++;
}
}
if(n == 3){
if(t == 1){
cout << "Y" << endl;
}
else{
cout << "N" << endl;
}
}
if(n == 4){
if(t == 2){
cout << "Y" << endl;
}
else{
cout << "N" << endl;
}
}
if(n == 5){
if(t == 3 || t == 2){
cout << "Y" << endl;
}
else{
cout << "N" << endl;
}
}
if(n == 6){
if(t == 4 || t == 3 || t == 2){
cout << "Y" << endl;
}
else{
cout << "N" << endl;
}
}
if(n == 7){
if(t == 5 || t == 4 || t == 3 || t == 2){
cout << "Y" << endl;
}
else{
cout << "N" << endl;
}
}
if(n == 8){
if(t == 6 || t == 5 || t == 4 || t == 3 || t == 2){
cout << "Y" << endl;
}
else{
cout << "N" << endl;
}
}
if(n == 9){
if(t == 7 || t == 6 || t == 5 || t == 4 || t == 3 || t == 2){
cout << "Y" << endl;
}
else{
cout << "N" << endl;
}
}
if(n == 10){
if(t == 8 || t == 7 || t == 6 || t == 5 || t == 4 || t == 3 || t == 2){
cout << "Y" << endl;
}
else{
cout << "N" << endl;
}
}
}
return 0;
}
2019计算机学科夏令营上机考试:跳蛙
最新推荐文章于 2021-07-20 09:34:53 发布