QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#762192#2513. A Color GameSanguineChameleon#AC ✓195ms12144kbC++201.7kb2024-11-19 14:07:212024-11-19 14:07:21

Judging History

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

  • [2024-11-19 14:07:21]
  • 评测
  • 测评结果:AC
  • 用时:195ms
  • 内存:12144kb
  • [2024-11-19 14:07:21]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pii pair<int, int>
#define pb push_back
#define debug(x) cerr << #x << "=" << x << endl
#define pq priority_queue
#define inf 0x3f
#define rep(i,a,b) for (int i=a; i < (b); i++)
#define MP make_pair
#define SZ(x) (static_cast<int>(x.size()))
#define MOD 1000000007
#define ALL(x) x.begin(), x.end()
void inc(int &a, int b) {a = (a+b)%MOD;}
void dec(int &a, int b) {a = (a-b+MOD)%MOD;}
int lowbit(int x) {return x&(-x);}

const int MAXN = 555;

int dp[MAXN][MAXN][7];

map<char, int> mp;
int val[MAXN];
string s;
int m;

void solve(int l, int r) {
    if (dp[l][r][0] != -1) return;
    rep(i, 0, 7) dp[l][r][i] = -MOD;
    if (l == r) {
       dp[l][r][val[l]] = 1;
       if (m == 1) rep(i, 0, 7) dp[l][r][i] = max(0, dp[l][r][i]); 
    } 
    else {
      bool check = false;
      rep(mid, l, r) {
        rep(i, 0, 7) {
          solve(l, mid), solve(mid + 1, r);
          dp[l][r][i] = max(dp[l][r][i], dp[l][mid][i] + dp[mid + 1][r][i]);
          if (dp[l][r][i] >= m) check = true;
        }
      }
      if (check) rep(i, 0, 7) dp[l][r][i] = max(0, dp[l][r][i]);
    }
    return;
}

int32_t main() {
    ios_base::sync_with_stdio(false);cin.tie(0);
    mp['R'] = 0, mp['G'] = 1, mp['B'] = 2, mp['C'] = 3, mp['M'] = 4, mp['Y'] = 5, mp['K'] = 6;
    cin >> s >> m;
    int n = SZ(s);
    rep(i, 0, n) {
        val[i] = mp[s[i]];
 //       debug(val[i]);
    }
    memset(dp, -1, sizeof(dp));
    solve(0, n - 1);
    rep(i, 0, 7) if (dp[0][n - 1][i] >= m) {
        cout << "Yes";
        return 0;
    } 
    //debug(dp[3][8][0]);
    cout << "No";
}

详细

Test #1:

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

input:

BBBRRRRRRGGGB 3

output:

Yes

result:

ok single line: 'Yes'

Test #2:

score: 0
Accepted
time: 2ms
memory: 12024kb

input:

BBBRRRRRRGGGB 4

output:

No

result:

ok single line: 'No'

Test #3:

score: 0
Accepted
time: 0ms
memory: 12084kb

input:

RRRRGGGRRRRRG 3

output:

Yes

result:

ok single line: 'Yes'

Test #4:

score: 0
Accepted
time: 39ms
memory: 12048kb

input:

GMYCGMRMGYMRMKCBKBMKKBMMKBBKMBMRRMGYKKMBKMYRGGBMRMKKKBRCMKYCCKYGYYKKCKRCYGGKGRBCKMYMRCRGBRRYCCKKRRKRCKMMMGCCGYYKMCRGMKCYBMRRKYYRRKGGRBMCKGBBYYGGGBBYBBRCCMGKKGRGRMRRBRCYGGGKBRKCBYCKMMBRCGKCCYYMMCKGRBYRRGBBCGYKBBMKRBBKGCRBYCKMYKMCKMBRMGGYBKBRBMYGGCKYCMYKBRCCGCYRRRKCKCBKCMCYBKRBKMCCYRBKBGGMGMCBGMBMYCCK 1

output:

Yes

result:

ok single line: 'Yes'

Test #5:

score: 0
Accepted
time: 41ms
memory: 12068kb

input:

KKCCCCCKYYYYYYKKKCRRCCBBBGGMMGCKKBBBBBRCCRRCRRYYCCYYBGGGBKKKBKKKCMKKMCCCGGGCCCCBBBCCKMMMKCCYYBBCCCCCCCCCYYCCCCBMMBRRRBBGGMKKBYMMMYYBBBBYYYYKCCCMMCKKMMMKKGGMBBRRBBBBKKBBBMMMMKKMMMKKKMMYYGMYYYMRRBMMMBGRRGGMMCCGRRBBBGCGGGCBBBCCBGGGGCRKKBBBRRYYYBBBYYKKKYYYBBYYBBBBCCCRKYGGGYYKKKKKKKKKRCCCYKKRRRKKMMMKMMC 2

output:

Yes

result:

ok single line: 'Yes'

Test #6:

score: 0
Accepted
time: 40ms
memory: 11980kb

input:

BYCCCYYBMMMMMMMMGYYYBBBYGBBBGGGKKKKKKGGGKKKBBBBKKBBBYYGGGGYGGGMGGGGMCMCCCMMMYYYYYYYYYYYCCCGGGCCRRRCRRBBBBRCCCCCGYCCCCCCYYCCCGGMGGRRRBCCCBMMMMBRCCCCGYYYGRYYYRRMMMMMRRRRMCBBGGGBBGYYYGGGCCGGGGMMBBGGRRRRGBRRRRYYYYBCCCYCCKKKMMMMCCYGGGYCBBBYYYYCCCCYCCCMMMMYYCBBBBBBBCCCCCGGGGCCCGGGGCCBBBBBGGGGMMMBKKKKMMM 3

output:

Yes

result:

ok single line: 'Yes'

Test #7:

score: 0
Accepted
time: 40ms
memory: 12000kb

input:

RMMMRRRRRRMMMMMMMMMMMMMGGGGBBBBMYYYRRRRRRYYMMGGGGMMMYMMRRRKKKKYYYYYYMMMMMMRRRRRKRKKRKKKKRRRKYYYKKKKYKCCCMMKKKKKMMMCKRRRKKKKRRRRRMMMGGGGGGMMMRCCCCYYYYCCCBBBBCCYCCCCCYYYYRRYYYYRRRRRRRRRRRRRBBBKKKKBRRRRBRRRBBBBBGGGGGGBYGGGGGGYKRBBBBBBRRRCCCCCCCCCRRRRRRRRKCCCCKYYYYKKKMMMMKKKBBMMMMBBBBBBBBKKKKKKRRRR 4

output:

Yes

result:

ok single line: 'Yes'

Test #8:

score: 0
Accepted
time: 37ms
memory: 12052kb

input:

BBKKKKKBBBCCCKKKKKKKKKKKKKCCKGGGGGGGCCCCCCMMMMMMMRRRRRRRRRYYKKKKKKYYYRRRRRKKKKKCBBBBBBBBBBRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRBGGGGGGBBBRRRRMMMMMRMMYYYYYYBBBBMMMMMBBYMMMKGGGGGGGKKKKMGGRRRRRRGGGGRRRRRRRYYYKKKBBBBBBKKKCCCCCCKBBBBBBYBBBBBBBBBBBBBBYYBBBBBBBBBBBYYCCCCCYBBBBBBYRRRRRRYMMMMMMGGGGGGGMMMMMYY 5

output:

Yes

result:

ok single line: 'Yes'

Test #9:

score: 0
Accepted
time: 43ms
memory: 12112kb

input:

BBMMCCCCCCCCCMMMMKKKKKKMMMBCCYMMMMMCYYYYYYYCCCCCMMMMMMMYYYYMMMMCCCYYYYYYYYYCCCCMMMMMMMMCCMMMYCCCCCBBBBBBBBBRRRRRRRRBMMMMMMMGGGGGGGGGGGGGGGGGMMMMMMMMMMGGGGBBBBBBBCCCCCCBBGGCCCCCCMMMCCCCCCCCKKKKKKKCMMMBBCMMMMMMMMCCCBBBKKKKGGGGGGKKKKKBBBBCCCCMMMMMMRRRRRRGGGGRRRRRRRGKKKKKKKKKKKKKKKKKKKKKKMMMMMMMMKKGGGG 6

output:

Yes

result:

ok single line: 'Yes'

Test #10:

score: 0
Accepted
time: 42ms
memory: 12068kb

input:

GGGGGGGGGGGGGGGGRRRRRRRRCCCCYMMMMMMMMCCCCCCCCCCMMMMMMMMMMMMMYYMMMMBBBBBBBBMMMMMYMGGGGGGGGGGGGGGGGGGGGGMMMMMMMMMMMMBBBBBGGGGGGGGGGBBBBBBMMMMKKKKKRRRRRRRRRRRKKKKMMMMMMMYYYYYYYYYYKKKKKKKKKYYYYYBBCKKKGGGGGGGGGGGGKKKKKCCCCMMMMMMMMMMCCCCCBMMMMMMMMMMMBBBBBBBYMMMMMMMMMMMMYYYYYYYYYYYYCGGGGGGGGGGCCCCGG 8

output:

Yes

result:

ok single line: 'Yes'

Test #11:

score: 0
Accepted
time: 38ms
memory: 12112kb

input:

MMMMMMMMMMMMMCCCCCCCCCCCGGGGGGGGGGGGGGGGGGGCCCCCCCCCMMMMKKBBBBBBBBBBBBBBBBKKKKKKKKKKKKKKKKKKKKKKKKBBBBBBBBBBBBBBBBBBBBBBBBRRRRRRRRRRRRRRRMMMMMMMMMMMMMMMCCCCCCCCCCCCCCCCCCCCCCMMMRRRRRRRRRBBBKKKKKKKKKKKKKKKCCCCCCCCCCCCCRRRRRRRRRRRRRRRRRRCCCCCCCCKKKKKKKMKKKKKKKKKKYYYYYYYYYYYYYYYYYYKKKKKKKKKMM 16

output:

Yes

result:

ok single line: 'Yes'

Test #12:

score: 0
Accepted
time: 42ms
memory: 12120kb

input:

GGGGMMMMMMMMMMMMMMMMMMMMMMMMMMRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYMMMMMMMMMMGGGGGGGGGGGGGGGGGKKKKKKKKKKKKKKKKKKKKKKKKKYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBKKKKKKKKKKGGGGGGGGGGGGGGGGGGGGGG 30

output:

Yes

result:

ok single line: 'Yes'

Test #13:

score: 0
Accepted
time: 0ms
memory: 12020kb

input:

RGB 1

output:

Yes

result:

ok single line: 'Yes'

Test #14:

score: 0
Accepted
time: 0ms
memory: 11976kb

input:

BBRBBBRBRBBBRRBBRRBBRRRRBBRRBBRRBRRRRRRBRRRRBBBRBRBBBRRBBRRBBRRRRBBRRBBRRBRRRBBBRRRBRRRBB 4

output:

Yes

result:

ok single line: 'Yes'

Test #15:

score: 0
Accepted
time: 11ms
memory: 12108kb

input:

YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY 200

output:

Yes

result:

ok single line: 'Yes'

Test #16:

score: 0
Accepted
time: 14ms
memory: 12040kb

input:

YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY 300

output:

No

result:

ok single line: 'No'

Test #17:

score: 0
Accepted
time: 0ms
memory: 11964kb

input:

BBBBBBBBBBBBBBBBBBBBBBBBBBBRRRBBBBGGGGGGRRRRRRRR 3

output:

Yes

result:

ok single line: 'Yes'

Test #18:

score: 0
Accepted
time: 46ms
memory: 12052kb

input:

GCGRRRRRGCCBKMMBBYYYYYKRCCCMCCGCCGGGRGGBRRRBRMMMYCCYRKMRRRRRCRMMMCCCMCRRCGGCMMMKKMMCKKMCMKMCYKCCCCKBKKKKMKKKBBBBBRYKKBBGGGYYRRCBBCYYKKKKKKYMYYCKYKKCCYYYBCCCMCGMGGGRGRRKRGGKGMGKBKGGBRMMMKGKGKRRBBKKKGGRRRRGBBKKKRRRKRMMMMRGGGYGCCCCRCMKKKCGRRRGBBYMCCCMRBBCCGBBGBBRMMKKRYYYYYKKKKYYYRRYGKRMMMYYRCCCYYYCMMMR 2

output:

No

result:

ok single line: 'No'

Test #19:

score: 0
Accepted
time: 102ms
memory: 12084kb

input:

BBKKYGGGGYKKKKKCCGGCKKKMMBRRRBBBBBKKKKRRRRBYYBBBBMBBBMYCMMMMBBBCCYCCCYYYYMMCCCBBGGGRRGGGRRBMMMMRRRRMYYYYKKMCCCCMKMMMMKKMKGGCCCCBBCYYYCGGCCCCCYYYYCRRRRRRRRRRRRRRRMRYYYRRMBBBBKGGBBBBMGRRRRYBBYYYGGKKKKCCCMRYGGKGGGGKKKKKYGMMMGGBBBBBBBBGGGGGGMMMGGYBBBBRMCRRRRRYYYYBRYYYKKKKKRRYYYYRRRRBBRYYYBBBCCCYYYYYYMMY...

output:

No

result:

ok single line: 'No'

Test #20:

score: 0
Accepted
time: 192ms
memory: 11988kb

input:

BCCCCYYYYBBYMMMMBBBGGMGGGMMGGGKKKGGGGGGGGGYYYYMYYYRRCCCKYYYYYKKRRRRKKKRRRRRRRRRGGGRMMMMRRCRRRRRCCMMMMCCCCCCCCCGGGRRCCCCCRRRBBBRRGGMMMGGGRRBRMMCCCCMMRKKKKKBBBBBKRBBCCCCCCCCRRRRMMMMMMMMGYYYGGRRRRGGGGRRRCCBBRRRCMMMMMMMMGGGBBBBCCCCMMMMMBYYMMMYBBYYYYBBBBGGGGMMMMMMGBBKKKRRRYYYBBBYRRKBGRKKKKKKKKKKRRRRCMKKK...

output:

No

result:

ok single line: 'No'

Test #21:

score: 0
Accepted
time: 189ms
memory: 12088kb

input:

BGGGGGGMRRRRRRRRRRMMMMMBMMMMCCCCCCYYMMMMYYBBBBBGKKKKKKGGGGBRRRRBBMMMMMMBGGGGGBYYYCCCCCYBBBGRBBBBBRRMMMMMMRRRRRMMMMRRGGGGCBBBBBKKKKKKCCCCCCCCCRBBBGGGGGYYYYBGGGGYYYYRGGGGGYCCCCYYYYYRRKKRRRRRBBBBBBKKKKYYYYRGKKBMMMMBBBBBRRRRRRKKGGGGRRRRRYKKKKKYRRRRRMMMMRRRRBBBBBMMRRRRRRRBBBBBYYYYYCCCCCBBBBBBKCCCCKKKYYYG...

output:

No

result:

ok single line: 'No'

Test #22:

score: 0
Accepted
time: 189ms
memory: 12032kb

input:

BBBBMMMMMBBMYYYYYMMCCCCCMMMKKKKYYYYYYKKGGGGGMMRRBBBBBBRRRRRCBBBBBBBCCCCRRYYYYYYYRRRRYYYYYYGGRRRRRRRRRRRCCCCCCGGGRRKKYYYYYKKCCCCCKRRRRMRRGGGGGGGRMMMMMMMRGGGGYYKKKKKRRRRRKYYYYGGMMMMMMMMMMMMMGCBBBBBBBBBBBBBCGGGGGYYYYYYYCCCCCRRRRRGGGGGGGYYYYYYYCYYYYYCKKKKKKKKKCCCCCCKKCGGGGGGGMMKKKCCCCCCCKKCCCCCKBMMMMMGG...

output:

No

result:

ok single line: 'No'

Test #23:

score: 0
Accepted
time: 186ms
memory: 12084kb

input:

BBBBBBBRRRRRRRRRRRBMMMMMMMMMBBBBGGGGGMMMMMMMMMMMGGRYYYYYGGGMMMMMMMMMMGGGGGGYKKKKKKKKKKKYYYYYCCCCCBKBBBBBBBBBBBKKKGGGGMMMMMMMMMGGGGGGGKKKKKBBBBBBBBCGGGGGGGGGCCCCRRRCCCCCYYYYYYYYYYYCCCCCCCCCCCCCCCCCCYYYYYYYYYYCCCRRRRRRRRRRCCCCCCCCCCCCCCBBBBBBBBBRRRRRRRRRRRRRYYYYYYYYYMMMMMMMMMMYRRRRRRRRRRRRRMGGGGGGGGGG...

output:

No

result:

ok single line: 'No'

Test #24:

score: 0
Accepted
time: 186ms
memory: 12084kb

input:

MMGGGGGGGGGGGGGGGGGGGMMMMMMMYYYGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGYYYYYYYYYYYYYYYYMGGGGGGGGGGGGGGGGGGGCCCCCCYYYYYYYYYYYYYKKKKKKKKKKKKKKKKKKKKKYYYYYCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCYCCCCCCCCCCCYYYYYYYCCCCCCCCCCCCCKKKKKKKKKKKKKKKKKKKKCCCCCCCCYYYYYYYYYYRRRRRRRRRRRRRRRRRCCCCCCCCCCCCCCCCCCCC...

output:

No

result:

ok single line: 'No'

Test #25:

score: 0
Accepted
time: 193ms
memory: 12076kb

input:

MMMMMMMMMMMMMMMMMMMMMMKKKKKKKKKKKKKKKKKKKKKKKKKKGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGKKKKKKKKKKKRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK...

output:

No

result:

ok single line: 'No'

Test #26:

score: 0
Accepted
time: 0ms
memory: 12040kb

input:

GRRRRRRGGGGGGGGGGGGGBBBGGRRRGGGGGGGGGGGRRRGGGBBBBB 3

output:

Yes

result:

ok single line: 'Yes'

Test #27:

score: 0
Accepted
time: 43ms
memory: 12048kb

input:

GGGGCCMMRRYRRRYYKKKKKBBKRRRYYYRYYYMMMYGCCCKYYYKKCCCGGGCBMMCCBCMMBBBKKKBBGGBKKKMYYKMMMKKKYYKKCCMMCRRRRRYKRRKBBBBRRCCRMMGGBBBKKBRGGRRRRYYRRRYRRKBBGGKRRRRKKKGYYYGYYRGCCCGGGCBMMMRRMMMMKKGGGKBBKBMMCBBBCKKCCBBBKKCGGYYYMMMYYCBMKKKKKMMBYGGBBBGBRRRRRBGCCCGMMGBBBYBBBBBBCCRBBBRCCCYYCBBMRRMCCCRRRBBBYRRRYYCYKKK 2

output:

Yes

result:

ok single line: 'Yes'

Test #28:

score: 0
Accepted
time: 95ms
memory: 12060kb

input:

MMMKKKKKKKKGGGGKBBBBKKKKBCBBBMMMGGGGMCCCCCCCCMMMGGGMCYYYYYYYCCCCBBBGGGBGGBBBYBBBBYYYGGCCCCCKKKKKKKKBBYYYYBBCCCBBBYYYYBGRRRKKMMMKKRGGCCCCCCBBBYYYGMRRRRMMGGGMMMMMMGGGCCCMMBBBBBRRRRBYYYYRYYCBBCCCYYYYCBBCCCKKKKCBMMMKKBBBKKBRRYYYYRBBGYYYYGRRRRRRRRGGBKKKKMMMMMMMBBBBRRRKKKBCKKMMMMKKCCYYYBYYBBBMMRRRRMMYYCCC...

output:

Yes

result:

ok single line: 'Yes'

Test #29:

score: 0
Accepted
time: 193ms
memory: 12008kb

input:

CCCCCRRGGGCCMMGGGGGGMMMCCMMMMMGGGGGYYYYRRRRRRRRRRRRRRRGGMMMMMRYYBGGGGBBBBYYYYRRBBKKKKKKBBBKYYKBBBBBKKKYGGGGYKKKKYKKKRRRMMMMMRKKKKKRRYYYBBBBBBYYYKKKKKKRRRRRRYYYYKKGGGGGKBBMMKKKKKKMMBMMMMKKKKKKMYYYYBBMMMYYYYMMBKKYYYYYYYYYYYYYYYBBBBBBKCCCCKCRRRRCKKBBBBMMMMMMMMMMMMYYYYYYKKKKCCMMMYKYYYYKKKYYYYYRRRRMGGGGG...

output:

Yes

result:

ok single line: 'Yes'

Test #30:

score: 0
Accepted
time: 189ms
memory: 12092kb

input:

MYYYYYRRMMMMGGGGGGMYYYYYMMRYYYYYBBBBBBMMMMMRRRYMMMBBBRCCCCCKKKKKCCCCCCCRRRRRRRRRRCCCCCCCRRBBBBBBRRRCCCCCCRKKKYYYYYKKBBBRRMMMMMMMRRYYYYYYCCCGGGGGGCKKKKKKKKKKKKKKCCCCCCCCRKKKKKKMMBBCCCCCBBBBBBCBBBBRYYYYYYRRRRRBBBKKKGGGGGMMMMMGGKKKKBBGKKKKKGBBBBBBBGGGGKKCGGGGGCBBBBRRRRMMMMMRBCGGGGGGGGGCCCCBBBBBBCCCGGYY...

output:

Yes

result:

ok single line: 'Yes'

Test #31:

score: 0
Accepted
time: 195ms
memory: 12072kb

input:

CCMMMMMMCCRGRRRRRRKKKKKKKKRGRBBBBBBBBBBBBBBBBBRRRRRRRRRBRRRRRRRRRRRRRRGGMMMMGGGGGGGKKKKKCCCCCCBBBBBBBBBCKKKKGMMMMYMMMMMMMYYYYYYYYYYYYYYYYYYYYYGGGGBBBBBBBGGGYYYYYYYYYYMMMYYYYYYMMMMGGGKKKKKKKKKKKKKKGGRRRRYYYYYYKKKKKYYYYYYYYYKKYKKKKKKKBBBBBBBBBBBBBMMMMKGGGGGGGKMMMMMMBBBBBBBBMMMMMMMMMMMMMMMMKKKKKKKKKMMC...

output:

Yes

result:

ok single line: 'Yes'

Test #32:

score: 0
Accepted
time: 187ms
memory: 12112kb

input:

MGGGGGMMMMMMMKKKKKKKKKKKKMMMMMGGGGGGGGGGGGGGCCCCCCCCCCYYYYYYYYYYYYYYCGGKKKKKKKKKKKGGGGGGGGGCCCGMGGGGGGGGGGMMMMGGGGGGGGGGGGMMMKRRRRRRRRRRRRRRRKKKBBBBBBBBBBBBBKKKKKKKKKMMMRRRRRRRRRRRRRRRRRRRRRRBBBBBBGGGGGGGGGGGGGGGGGGGGGGGBBBBRRRRRGGGGGGGGGGGGGRRBBBBBBBBBBBBBRRRBBBBBBBBBBBBBBRRRRCCCCCCCCCRRRRRRRRRRRRR...

output:

Yes

result:

ok single line: 'Yes'

Test #33:

score: 0
Accepted
time: 180ms
memory: 12092kb

input:

CCCCCCCCCCCCCMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMCCCCCMMMMMMMMMMMMMMMMMGGGGGGGGGGGGGGGGGGGGGGMMMMCCCMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMRRRRRRKKKKKKKKMMMMMMRRRRRRRRRRRRRRRRRRRRRRMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMKKKKKKKKKKKKRRGGGGGGGGGGGGGGGGGGGGGGGGGGGRRRR...

output:

Yes

result:

ok single line: 'Yes'

Test #34:

score: 0
Accepted
time: 187ms
memory: 12144kb

input:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYBBBBBBBBBBBBBBBBBBBBBBBBBB...

output:

Yes

result:

ok single line: 'Yes'

Test #35:

score: 0
Accepted
time: 0ms
memory: 12088kb

input:

GBBGGGBBBBBGGBBBBBBBBBBBBRRRRGGBBBRRRRRRRRRRRRRRR 4

output:

No

result:

ok single line: 'No'

Test #36:

score: 0
Accepted
time: 2ms
memory: 11952kb

input:

BBBBBBBBBBBBBBBBBBBBBBBBBBBGGGGGGBBRRRRBBBBBBBBRR 5

output:

Yes

result:

ok single line: 'Yes'

Test #37:

score: 0
Accepted
time: 0ms
memory: 12016kb

input:

GGBBBBBBBBBGGGGBBBBBBBGGGGGRRRRRRRRGGGGBBGGGGGGGGG 8

output:

Yes

result:

ok single line: 'Yes'

Test #38:

score: 0
Accepted
time: 2ms
memory: 12084kb

input:

RRRRRRGGGGGGGGGBBBBBBGRRRRRRRRRGGGGGGGGBBBBRRRRR 10

output:

No

result:

ok single line: 'No'

Test #39:

score: 0
Accepted
time: 0ms
memory: 11972kb

input:

RRRRRRRGGGGGGGRRBBBBBBBBBBBBBBBBBBBRRRRRBBBBBB 5

output:

Yes

result:

ok single line: 'Yes'

Test #40:

score: 0
Accepted
time: 2ms
memory: 11964kb

input:

GGGGKKMGGMMMYGGGKKKKKGCCCCYKKKGGYYGGGMRYYRRRYRMM 3

output:

No

result:

ok single line: 'No'

Test #41:

score: 0
Accepted
time: 3ms
memory: 12084kb

input:

YYYYYCKMMMMMYYYKKKKKKKKBBBCCCCKCCBBBCRRBBBBRRRCCC 4

output:

No

result:

ok single line: 'No'

Test #42:

score: 0
Accepted
time: 0ms
memory: 11956kb

input:

CMCCCCMMMCCCCCGCCCCCCCMMMMMKKKKKKCCCGGGGGMMMM 5

output:

No

result:

ok single line: 'No'

Test #43:

score: 0
Accepted
time: 2ms
memory: 12032kb

input:

KKKKKKYBBBBBBBBBBBBCCCCCCCCCCGGGGGGCCGGGGGGGCCYYYY 6

output:

No

result:

ok single line: 'No'

Test #44:

score: 0
Accepted
time: 0ms
memory: 11956kb

input:

GGGGGGYYYYYYYYYYYYYYYMMMMMMKKKKKKMMMMMMMMYYYYYYYYG 7

output:

No

result:

ok single line: 'No'

Test #45:

score: 0
Accepted
time: 0ms
memory: 12088kb

input:

BCCYYYYYYYYYCCCCCCCCCBBBBRRKKKKKKKKKKRRRRRRRBBBBBB 10

output:

No

result:

ok single line: 'No'

Test #46:

score: 0
Accepted
time: 2ms
memory: 11948kb

input:

YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYKKKKKKKKKKKKKKY 15

output:

No

result:

ok single line: 'No'

Test #47:

score: 0
Accepted
time: 0ms
memory: 12020kb

input:

YYYYYYYKKKKKKKKKKKKKKKKKKKKYYYYYYYYYYYYY 20

output:

Yes

result:

ok single line: 'Yes'

Test #48:

score: 0
Accepted
time: 0ms
memory: 12092kb

input:

GGGGGGGGRRRRRRRRRRRRRRRGGGGGGGGGGGGRRRRGGGGGGGGG 10

output:

Yes

result:

ok single line: 'Yes'

Test #49:

score: 0
Accepted
time: 0ms
memory: 12008kb

input:

GGCCCCGMGGGBRRRRKKGGGBGGGGBBBKKKKKBBBMMBKBBGKKKKKKKKMMYYYYMMMMMMMMMMMMYYRRRGGYM 3

output:

No

result:

ok single line: 'No'

Test #50:

score: 0
Accepted
time: 0ms
memory: 12028kb

input:

YYYGGGRRBGGGGGMCCCCCMMMMBBBBBMMYYYBBRRBBBBBCCCBBBBGGGGGGGGGGGMMMCCCCCCMMMMMCCG 4

output:

No

result:

ok single line: 'No'

Test #51:

score: 0
Accepted
time: 0ms
memory: 12088kb

input:

GGYYYYGGGCCCCCMMMMRRRRRRMCCCCCYYYYCGGGGGCCCKYYYYYYYKYYYYYKKKKKYYKKKGMMMYYYYYM 5

output:

No

result:

ok single line: 'No'

Test #52:

score: 0
Accepted
time: 0ms
memory: 12040kb

input:

KKGGGGGGKKBBBBBBKRKKKKKRRRRRRMMMMMMMKRRRRKKKKKKRYYYYYYRYYYYYYGKKKKKKKGGGGYCCCCCC 6

output:

No

result:

ok single line: 'No'

Test #53:

score: 0
Accepted
time: 0ms
memory: 12032kb

input:

YYYYYYYYYYYMMMMGGGGGGGGKKKKKKKRRRRRRRRRRRKKKKGGGMMMMMGCCCCCCCCCGGGGGGGG 10

output:

No

result:

ok single line: 'No'

Test #54:

score: 0
Accepted
time: 0ms
memory: 12028kb

input:

RRRGRRRRRRRGGGGRRRR 4

output:

Yes

result:

ok single line: 'Yes'

Test #55:

score: 0
Accepted
time: 7ms
memory: 12048kb

input:

YYMMMRRMMMRRBBYYYGCCCCCKMMCCCCKYYRRRRYYCCGGMMRMMMGGGCCGBBGRRGGGBBYMMMYYBBYYMMMMMMMYMMMMYRRRRCBYYYYBBRRBBRRBCCRRRRRRCCKKKKRRCGGCBKKKKRRBBBRRBBBRRRRCR 3

output:

No

result:

ok single line: 'No'

Test #56:

score: 0
Accepted
time: 7ms
memory: 11960kb

input:

MMMYYYYYYGGGGYYCGGGBBMGGKKKKGGMMMBGGGBGGGGYYYYYGBKYYYYYKKKBRRRRRBGGMMMMBYYYYBBCCCCCBBKKKYYYYKCCBBBBGGGCCKKKKCMRRRMKKKMMCCBBBMMMYGGRRRGGGBBBGGGGGKKKKKB 4

output:

No

result:

ok single line: 'No'

Test #57:

score: 0
Accepted
time: 7ms
memory: 12032kb

input:

MMCCCCCCMKKYCMMMMMCMMMCCCCCCMMCRMMMMMMRRRCCCCCCMMMMMCGGGGGGMMMMMMYYYYYMMMMMMMMMMMKKYYGGGGGGYYYYKKMRYCCCCCYYYYRRRRKMGGGGGMMMMMKMMMMRRRRMMMRRRRRYYYYYR 5

output:

No

result:

ok single line: 'No'

Test #58:

score: 0
Accepted
time: 8ms
memory: 12048kb

input:

MCCCMMMMMMMCCCCMMMMMMMMMMCMMMMRRRRRRKKCCCCCCCCCCCKKKKKRRRRRCMMMMMMMCYYYYYYCCCBBBBBMCGGRGGGYYYYYYYYYYYGGRRRGGGGGBBBBBGRGGGGCGGGGGBBBBBBCCCKKCCCCCCKKKKK 6

output:

No

result:

ok single line: 'No'

Test #59:

score: 0
Accepted
time: 3ms
memory: 12032kb

input:

RRMMMMMMMRRGGYYYYYYYYGGKKKKKKKKKKKKKKCCCCCCCCKRRRRRRRYYYYYYCCGGGGGGGGCCCCGGGGGGGGCYYRMMMMMMMCCCCCCCKKKKKKKKKGGYYYYYYYYGGGMMMMMMCCCCYYYYYYYCCCCCMRRR 8

output:

No

result:

ok single line: 'No'

Test #60:

score: 0
Accepted
time: 7ms
memory: 12052kb

input:

GGGYYYYYYYYYYGGBRRRRRCCCCCCKKKKKKKKKKCCCCCRRRRRRRRRRRKKKKKKKKKGGGGKKKKKKKKKGGGGGKKGGGGGGGGGGGRRBBBBBBBBBBRRRRRRRRCCCCCCCCCRRBBBBBBBBBBBBBBBBBBGGGGGG 10

output:

No

result:

ok single line: 'No'

Test #61:

score: 0
Accepted
time: 3ms
memory: 12016kb

input:

CCCCCCCCCCCCCMMMMMMKKKKKCCCCCCCCCCCCMMMCCGGGGGGGGGGGGGGGCCCCCCCCCCCCCCCCCCCCCCCCCCCMMMMMMMMMYYYYYYYYYYYYYYYMMCCCKKKKKKKKKKGGGGGGGGGGGGGGGMMMMMMMMMC 15

output:

No

result:

ok single line: 'No'

Test #62:

score: 0
Accepted
time: 0ms
memory: 11964kb

input:

BBBBBBBBBBBBBBBBBBBBBBBBBBBRRRBBBBGGGGGGRRRRRRRR 4

output:

Yes

result:

ok single line: 'Yes'

Test #63:

score: 0
Accepted
time: 13ms
memory: 11992kb

input:

KRMMRRRRGGGYYYGGGYMMMMMMMMKRKKKKKMMKYYYYKCCCRGGRGGGGGGRRRRKKRRRRYGGGGCCYYGRRGGCCCMMMMYYBBBBGGGCCCBKYYYKBBBRRRCCCRBCCCBKKBYYRRRYBBKKKBYYMMYBBYYYYYRRRYYYKMMMKKKKRRRRKKYYYRYMMGGMYYYYCCRMMMBBBBMBBBBGGGG 3

output:

No

result:

ok single line: 'No'

Test #64:

score: 0
Accepted
time: 11ms
memory: 12040kb

input:

CCCYYYCKKCCCCCRRRRYYYYYGGGCCCCCGBMYYYKKKKYBBBBBBGGGBGKKKKGGGGGGGMCCCCCMMYYYYYYYYYYMMKKKRRRRKMMMMKMMMMMYYYBCCCCCCCKKKCCCCCCCCBYYYYYBBBBBRYYYRKKKKBYYYYBBKYYYCCCKKRRRBBBYBBBBYYBCCCRRRRBBBBYBBMMMMYYYRKCCC 4

output:

No

result:

ok single line: 'No'

Test #65:

score: 0
Accepted
time: 7ms
memory: 12036kb

input:

KKKKKKKKKKCCCCCKMMMMMMRRKKKKKKRRKYYYYYKYRGGGGBKKKKMMMMMKBBBBBRRGGGGGRRRRRBBCCCCBBRRGGGGRYMMMCCYYYYYCCCCMMRRRRRMYBBBGBBBBBGGGGBBBCCCCCBRRRRRRRRRRBYBBBBBBYYYMMMMCCCCCMBRBBBBKKKKKKRRRYGGGGGYYCCCCKKK 5

output:

No

result:

ok single line: 'No'

Test #66:

score: 0
Accepted
time: 11ms
memory: 12112kb

input:

GCCCCCCCCCCCGYYYYYYGMMMMMGMMMMMMGGGGMMGCCCCCCCMMMMMGGGGMMRRRRRRRRKKYYYYYYKKMMMMMMKKKKKKKKRRRMMMCCCCCGGGGGGGGYYMMMMMYYYYYGKKKKKYYYYYYYGMMMKKKKKMMMMMMMRRRRRYYYYYYMMGGGBBBGGGGGGGBBGGGGGBKCCCCCKKRRRRRKKB 6

output:

No

result:

ok single line: 'No'

Test #67:

score: 0
Accepted
time: 14ms
memory: 12048kb

input:

CCCCCCCCGGGYYYYYYYGGGGGBBBBBCCCCCCCBGGGGGGGGBRRRRRRRRBCYYYYYGCCCCCCCCCGGGGGGGYYKKKKKKKKYBBBBBBMMMMMMMMBBYCKKKKKKMMMMMMMMKCBBBBBBBBKKRRRRRRRKKKKMMMMRRRRRRRRMMMMKKKCCMMMMMMMMMCCCCCCCCYYYYYYYCCCRRRRRRRR 8

output:

No

result:

ok single line: 'No'

Test #68:

score: 0
Accepted
time: 10ms
memory: 12032kb

input:

RRRRRRRRRRRRYYYYGGGYYYYYYYYYYYGGGGGGYMMMMMMMMMMMYYYYYYYYYYYKKKKKKKKKYYYKKKKKKKKKKYYYYYYYRRRRRRRRRRRYMMMMMMMMMMYRRYYYYYYYYKKKKKKKKKKKYRRGGGGGGGGGRRBBBMMMMMMMMMBCCCCCBBBBBBBBBBCCCYYYYYYYYYYYCBBBBBB 10

output:

No

result:

ok single line: 'No'

Test #69:

score: 0
Accepted
time: 10ms
memory: 12056kb

input:

GCCCCCCCCCCBBBBBBBBBBBBBBBCCCCCYYGGGGGGGGGGGGGYGGGGGGGGGGGGGGGYYMMMMMMMMMMMMMMMYYYYYYYYYYYYGGYYYYYYYYYYYYGGGGGGGKKKKKKYYYYYYYYYYYYYYYKKCCCCBBBBBBBBBBBBBBCCCCCCCCCCKKKKKKKGKKKKKKKKKKKKKKKGGGGGGG 15

output:

No

result:

ok single line: 'No'

Test #70:

score: 0
Accepted
time: 12ms
memory: 12100kb

input:

CCCBBBBBBMMMKKKKKGGGGGGGGGGGGGGGGGGGGGKKKKKKKKKKKKKKKMMMMMMMMMMMMMMMMMBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCMMMMMKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKGGGGGGGGGGGGGGGGGGGGGKMMMMMMMMMMMMMM 20

output:

No

result:

ok single line: 'No'

Test #71:

score: 0
Accepted
time: 3ms
memory: 11992kb

input:

BBBBBBBBBBBBBBBBBBBBBBBBBBBRRRBBBBGGGGGGRRRRRRRR 5

output:

No

result:

ok single line: 'No'

Test #72:

score: 0
Accepted
time: 14ms
memory: 11992kb

input:

CCCGRRRGGRRYYYRMMRRMMMBBBBGGGMRCCCCCCRRRCBBBBMBBBCCCCGGGGCCBBBBCGGGRRRRCCCYYYYYYYKCCCCKKKGCCCRCYRRRRYYYRRRRYYYRRRCYYYRRRRYYYCCCMMMMYRKKKYYYKRYYYYRRKKKCRYYYCCCCRMMMMKKKCCCRRRMMMMBBBBKKKKKRRRRMMMRKKKKRR 3

output:

Yes

result:

ok single line: 'Yes'

Test #73:

score: 0
Accepted
time: 11ms
memory: 11984kb

input:

CCCCCCRRRRRBYYYBBMMMMMMYGGGGGMMMMMGGGGGYYRKKKKRRRRYBBBBYMMMMMMCCKKKKKGGGGCCYBCCCCCGYYYYYYGGGGMMMCCCCCCCCCCCCRRRRRRBBBBCCCCMMBGGBBBBRRRRRRRRRBGCCCCCCKKKKKMMMMMBBBBBBBBBBKGYYYYKKKKKGMMMMMBCCGGGGGCKKKKKC 4

output:

Yes

result:

ok single line: 'Yes'

Test #74:

score: 0
Accepted
time: 14ms
memory: 12104kb

input:

YYYYYYYYYYYYYRYYYYYRMMCCCCCCCCCCCCCBBBBBBBCBBBBBBCCCCCCBGGGGGGGMMMCCCCCCRMMMMMKKKKKYYYYYYKRRRRRRKKKKKKKKKKKGGGGGMRRCKKKKKCRMMBBBBBBBMMMMMRCCCCCCCRRRCCCCCRRCCCCCCCCCCCCCKYYYYYKKKKKKCCCCCCCCCRRRRRRCC 5

output:

Yes

result:

ok single line: 'Yes'

Test #75:

score: 0
Accepted
time: 9ms
memory: 12040kb

input:

RRRRRRRRRGMRRKKKKKKGGGGGGGGKKRRRRRRRMMGMMMMMMMMRRRRRRRMGGGGGGGMMCCGMMMMMMMMMMMMMMMMGGGGMMMMMMGCCCCMCCCCCCCCCCCCGGGGGGGCCRRRRRGGGGGGRRRCCCCGCCCGGKKKKKKKKKKKKKKKMMMMMMMKGGGRRRRGGGGGGGGRRBBBBBBBBG 6

output:

Yes

result:

ok single line: 'Yes'

Test #76:

score: 0
Accepted
time: 11ms
memory: 12036kb

input:

MGGGGGGGGGGCRRRRRRRRRRRRRRRRRRRRRCCCCCCCCCCCCCMMMMMMMMMCCCCCCCCCCMMMMMKKYGGMMMMMMMMMMMMMMMMMMMMMGGGGGKKKKKKKKGGGYYYYYKKKKKKKKKRRRRRRRRRRKKYYYYYYKKKKKKKKKYYYYYYYYYYYYYYYYYYYYYYKMBBBBBBBBBBBBBBBBBBBMMMM 8

output:

Yes

result:

ok single line: 'Yes'

Test #77:

score: 0
Accepted
time: 9ms
memory: 12048kb

input:

CCCCCBBBBBBBBBBBBBBCCGGGGGGGGGGCCCGYYYYYYYBBBBBBBBBMMMMMMMMMMBBBBYYYYGCBBBBBBBBBBBGGGGGGGGGGGBCCCCCCCCCCCCCCGGRRRKKKKKKKKKKKKRRRRRRRGGGGGGGGGGGGGGGGGCCCCCRRRRRRRRRRCCCCCCCCCCCCCCCCCCCCCGG 10

output:

Yes

result:

ok single line: 'Yes'

Test #78:

score: 0
Accepted
time: 13ms
memory: 12032kb

input:

CCCGGCCCGGGGGGGGGGGGGGGGCCCCCCCCCCCCCCCCCCGGGGGGGGKKKKKKKKKKKKKKKKKKKKCCCCCCCCCCCCCCCCCCKGGGGGGGCCCCCKKKKKKKKKKKKKKKKKCCCMMMMMMMMMMMMYYYYYYYYYYYYYYYMMMMMMMMGGGGGKKKKKKKKKKKKKKKGGGGGGGGGGGMCCCCCC 15

output:

Yes

result:

ok single line: 'Yes'

Test #79:

score: 0
Accepted
time: 8ms
memory: 12048kb

input:

CRRRRRRRRRRRRMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMKKKKKKKKKKKKKKKKKKKKKMRRRRRRRRKKKKKKKKKKKKKKKKKKKKKKKKKRRRRCCCCCCCCCCCCGGGGGGGGGGGGGGGGGGGGGGGCCCCCCCCCCCCCCCCC 20

output:

Yes

result:

ok single line: 'Yes'

Test #80:

score: 0
Accepted
time: 10ms
memory: 12108kb

input:

KKKKKKKKKKKKKKKKKKBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBKKKKKKKKKKKKKKKKKKKKKKKKKKKKKBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBKKKKKKKKKKKKKKKKKK 25

output:

Yes

result:

ok single line: 'Yes'

Test #81:

score: 0
Accepted
time: 43ms
memory: 11980kb

input:

MKKGGGCGGGMMGMMYYYYGYYRRRRYCCYGGGMMCRRRCCKKCKRRKCRRRRCKKKRKKBBBYYYRGGGGGRRMMMMRBBRMMRRRKKKRRRRRRRRRGBBGRRGKKKCCCGGGGYYCBBKKYYYBYBBRRBBBBKGKKKRKKKRGGGGGGGCCCCYYYYGKKKKRRKCCCMMMMGGRRMKMMMKRYGGGGYRRYKCCCMCKKKKCCCRCCCRRGGRCCCCMMKMMMMKGGYBBYRRMMMYYMYYYRRRYYYCCYBYYBBBBYYGGGGYBBMMCCCCMRGGGGKKGRRMMYGGMMMMMM 3

output:

No

result:

ok single line: 'No'

Test #82:

score: 0
Accepted
time: 38ms
memory: 12016kb

input:

GMKKKKMMGBBKKKKKBBBBBBBBYYYBBBRRRBCCCBCGGGGRRYYYRKYYRRRRYYYKKKRRRYYYRKMMMBBBBCCMMMMMMMBBBBBMBBBBBMMMMBBBCCBBBCBCCKKKKKKKKBCCCCCBGGKKKGGGYMMGGGGGMMYYKKKYCCCCCCKKKYYYYCCRRRRYMRRRGGMBBMMMMBBBMMMGMMKRRRRKKRRRCYYYYCCCYCCKBKKKKBBCBBGBBBRRRRRBBCCCGGGRRMMYYYMMMMYYMCCCCMRRGMBBBBBBBMMBCCCYRYCCCCCCYYYYRRRRYY 4

output:

No

result:

ok single line: 'No'

Test #83:

score: 0
Accepted
time: 37ms
memory: 12056kb

input:

CRRRRRYYYYMMMMMMYYYYYYYYRRRRRRRRRRRRRBBBBRRRRRYYYYMMMMYCCBKBBBBBBKCKKKKCCCKKKYYYYGGGGKCKKKKKKCCCRRRRRRRBBBBCCCCGGGGGBBRBBBBBBBCMMMCCCCCCCCCCBBBBBMBBBBBMMMMGGGGGMMCCCCRBBKKKYYGGGGGYYKKKBBBBCCCCCCRRCCCCCRGGYYYYYGGGGGGGGYYMMMMMRKKKKKKRRRRMMMMGGGGGGMMCCCCMBBBBBBYBBBBBGGGBBBBBBGGBBBBBGYYRCBBBBCYYYYYY 5

output:

No

result:

ok single line: 'No'

Test #84:

score: 0
Accepted
time: 38ms
memory: 12000kb

input:

BBBBBBGGGGGGGBBBBBBBBBBBBBMCGRRRRRGGKKKKKKGGGCCMMMMMMMCKKKKRRRRRKCCYYYYYYYCCCCCCGGYYYYYKKKKKKYGBBBBBBBKKKKKKKBBBYYYYYBBGGBBBBMMMMMBBBGGGBBBBBBBGGGGGGGGGGGGGGGGGGGMGGGGGMYYYYYYMMMMRRRRCCCCCRRRRRRRRRRRRRRRMMMBBBKKKKKKGGGGGBBBBBBKKKKKKKGBGGCCCCCCCGGGGGBBCCCYYYYYYYCCCBBBBGGGGGGMMCCCCCCMMMMMBBMMCCCCCCC 6

output:

No

result:

ok single line: 'No'

Test #85:

score: 0
Accepted
time: 43ms
memory: 11996kb

input:

YYYYYGGGGGGGYKKKKKKKKYKKKKKKKYYRRRRRRRCCCCCCCCCCCCCCCCCCGMMMMMMMKKKKKKKKRGGGCCCCCCCCGGGGGGGGGGGGGGGGGGGGRKKKKKKKMMMMMMMMMMMMMMMMKKRRRRBBBBBBBBRKKKKKBBBBBBBBBBBBBBKRRRMMMMMMMMRRRRRKKGGGGGGGGGGGGGGGGGGGGKKKKKCCCCCCCCKKKKKKKKKKKMGGGGGGGCCCCCCCGGMMMMMMGGGGGKKKKKKKKKGGRRRRRRRRRGMMMMMMMYYBBBBBBBBBYYYYYYMG 8

output:

No

result:

ok single line: 'No'

Test #86:

score: 0
Accepted
time: 36ms
memory: 11976kb

input:

RRRCCCCCCRRRRRRRRRKKKKKKKKKKKRRCCCRBBBBBBBBBMMMMMMMMMRRRRRRCCCCMMMYYYYYYYYYMMMMMMYYYYYYYYYYYMMMMMMMMMMMMCCCCCKKKKKKBBBBBBBBBYYYMMMMMMMMMMMYYYYYYYMMMMMMGGGGGGGGGMMMMBBKKKCRRYYYYYYRRRRRRRRRBBBBBBBBBYYYYRRKKKKKKMMMMMMMMMMMKKBBBMYYYYYYYYYYYMMKKKKKKKKKMMMMMMMRRRRRRRRRBBBBBBBBBBBBBBBBBBKKKRRRRRRR 10

output:

No

result:

ok single line: 'No'

Test #87:

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

input:

CCCCCCCCGGGGGGGGGGGGGGGGCCCCMMMMMMMMMMMMMMMMCCCCCCCCCCCKKKKKKKKKKKKKKKCCCCCCCCCCCCCCCMMMMMMMMMMMMMMMMCCCCCCCCGGGGGGGGGCCCCCCCCCCCCCCCGGGGGGCCCCCCCCCCCCCCKKKKKKKRRRRMMMMMMMMMMMMMMMRRRRRRRRRRRKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCCCCCCCCCCCCCCCKKKC 15

output:

Yes

result:

ok single line: 'Yes'

Test #88:

score: 0
Accepted
time: 44ms
memory: 12056kb

input:

MMMMMMMMMMRRRRRRGGGGGGGGGGGGGGGGGGGRRRRRRRRRRMMMMMMYYYYYBBBBBBBBBBBBBBBBBBBBYYYYYYYYYYYYMMMMMMMMMMMMMCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCMMMMMMMYYYYMMMMMMMMMMMMMMRRRMMMMMMMMMMMMMMMMMMMMMMMMMMMMMBBBBBBBBBBBBBBGGGGGGGGGGGGGGGGGGGGYYYYYYYYYYYYYYYYYYYYYBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCMM 20

output:

No

result:

ok single line: 'No'

Test #89:

score: 0
Accepted
time: 34ms
memory: 11996kb

input:

YYBBBBBBBBBBBBBBBBBBBBBBBBBBBBBYYYYYGGGGGGGGGGGGGGGGKKKKKKKKKKKKKKKKKKKKKKKKKKKKKGGGGMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMGGGGGGGGGGYYYYYYYYYYYYYYMMMMMMMMMMMMMMMMMMRRRRRRRRRRRRRRRRRRRRRRRRRRRRRMMMMMMMMMMMMMYYYYYYGGGGGGGGGGBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBGGGGGGKKKKKKKKKKKKKKKKKKKKKKKKKKKKKGGGGGGGGGGGGGGYYY 30

output:

No

result:

ok single line: 'No'

Test #90:

score: 0
Accepted
time: 191ms
memory: 12016kb

input:

RBMKYGCGBRYMCKBCMRGYKGMKCBYRGRKYCBMKBMGCYRGYMCRKBGKMBCYRYMRBKGCKGBMRYCGMBKYRCGCMBRKYCGYBKMRBRKYGCMBGMCYKRCYKMBGRBYRMGKCRGBKYCMBMGRYCKMRCBYGKRMGKYBCKBRYCMGMCRBKGYMRKCGBYGYCMBRKGBRMYKCRGKMBCYKRGBCMYMGYCRKBYCBKGRMBGYKRMCRMCYKBGRKCGMYBCBKYMRGKGYMRBCRKBGYCMYRGBMCKBKGYMRCKMGBRYCMKYRGBCMBCGKYRYGMBKRCBCGRMK...

output:

No

result:

ok single line: 'No'

Test #91:

score: 0
Accepted
time: 186ms
memory: 12084kb

input:

RMGCKYBKGBCYMRYGBKRCMBGMCYRKMBCKGRYBMGCKYRBYCMRKGBMKRGYCBMKRGYCKYGBCMRYGCBRKMCGBMYRKRKBYCGMCMRKYGBCBRMKYGBKRCMYGRCGBYKMKMRGCYBRKBMYGCMRYBGCKRYCGMBKMCRBKYGYRCBGMKGRCYBKMRMKYCBGYKCBRGMYGCRMBKMYBCKGRBKYMRCGRYMBCGKRBMGYKCKMBCRGYKCBMGRYGMCRYBKGMCRYKBMYKRGBCBGRMYKCMGYBKCRGBCRMYKMCRKYBGBKYCRMGCRBGYMKBGKRMC...

output:

Yes

result:

ok single line: 'Yes'

Test #92:

score: 0
Accepted
time: 190ms
memory: 12136kb

input:

CBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKKRGBCMYKRGBCMYKRGBCMYKRGBCMYKRGBCMYKRGBCMYKRGBCMYK...

output:

No

result:

ok single line: 'No'

Test #93:

score: 0
Accepted
time: 186ms
memory: 12092kb

input:

CBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKYMCBGRKKRGBCMYKRGBCMYKRGBCMYKRGBCMYKRGBCMYKRGBCMYKRGBCMYK...

output:

Yes

result:

ok single line: 'Yes'

Test #94:

score: 0
Accepted
time: 186ms
memory: 12136kb

input:

MCCBBGRRKKYMCBGRKYYMMCBBGRRKYYMCBGGRKYYMCCBGGRRKYYMCBGGRRKYYMMCCBBGRRKKYYMCBBGRRKYMCBBGGRRKKYMMCCBGGRKYMMCBBGRRKYMCCBBGGRRKYMMCCBGRKKYYMMCCBBGRKYMMCCBBGGRKYYMMCCBBGRRKYMCCBGGRKKYYMCBGRKKYMMCBBGGRKKYMCCBGRRKYMMCBBGGRKYMCBGGRKKYMMCBGGRRKKYMMCCBBGGRRKKRGBCMYYKRGBBCCMYYKRRGBBCCMMYYKKRRGBCCMYYKKRGGBBCMMY...

output:

Yes

result:

ok single line: 'Yes'

Test #95:

score: 0
Accepted
time: 184ms
memory: 12076kb

input:

CBBGGRKKYMCBGRKKYYMMCBBGRKKYYMCBBGGRKKYMMCBBGRKYMCBGGRKYYMMCCBBGGRRKKYMCCBBGRRKKYMMCCBGRRKKYYMCCBGGRKKYMMCCBGGRKYYMMCBBGGRKYMMCBGGRRKYYMCCBBGRRKYYMMCBBGRKKYMMCCBGGRKKYMCBGGRRKKYYMCBBGGRRKYMMCCBBGRKYMMCCBGRRKKYYMMCCBGRKKYYMCBBGRRKYMMCCBGRRKYYMCBGRRKKRGGBBCCMMYKKRGGBBCMYYKKRGGBCCMMYKRRGGBBCMYKRGGBBCMY...

output:

No

result:

ok single line: 'No'