mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
1b77522684
4800-4899
27 lines
708 B
C++
27 lines
708 B
C++
#include <stdio.h>
|
|
#include <string.h>
|
|
#define maxn 32800
|
|
bool arr[maxn << 1];
|
|
int main() {
|
|
int n, m, i, j, cnt, cas = 0;
|
|
while(scanf("%d%d", &n, &m) == 2) {
|
|
memset(arr, 0, sizeof(bool) * n * 2);
|
|
for(i = j = 0; i < n; ++i) {
|
|
cnt = 0;
|
|
while(true) {
|
|
if(arr[j] == false) {
|
|
if(++cnt == m) break;
|
|
}
|
|
if(++j == 2 * n) j = 0;
|
|
}
|
|
arr[j] = true;
|
|
}
|
|
for(i = 0; i < n * 2; ++i) {
|
|
putchar(arr[i] ? 'B' : 'G');
|
|
if((i + 1) % 50 == 0) putchar('\n');
|
|
}
|
|
putchar('\n'); putchar('\n');
|
|
}
|
|
return 0;
|
|
}
|