-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschool-queue.cpp
52 lines (45 loc) · 855 Bytes
/
school-queue.cpp
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <limits>
#include <bitset>
#include <time.h>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <sstream>
using namespace std;
#define MOD 1000000007LL
#define LL long long
#define LD long double
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(x) ((x)<0?-(x):(x))
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,n) for(int i=(n);i>=0;i--)
const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
int main()
{
int n,t;
scanf("%d %d",&n,&t);
string s,d;
cin>>s;
d=s;
REP(j,t)
{
REP(i,s.length())
{
if(s[i+1]=='G' && s[i]=='B')
{
d[i]='G';
d[i+1]='B';
}
}
s=d;
}
cout<<s;
return 0;
}