We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d000d5 commit b0227a8Copy full SHA for b0227a8
266B - Queue at the School.cpp
@@ -0,0 +1,28 @@
1
+// ॐ नमः शिवाय
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+#define pb push_back
5
+
6
+// Code Written By: Vikash Patel
7
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8
9
+int main()
10
+{
11
+ int n, t;
12
+ string s;
13
+ cin >> n >> t >> s;
14
+ while (t--)
15
+ {
16
+ for (int i = 1; i < n; ++i)
17
18
+ if (s[i] == 'G' && s[i-1] == 'B')
19
20
+ s[i] = 'B';
21
+ s[i-1] = 'G';
22
+ ++i;
23
+ }
24
25
26
+ cout << s << endl;
27
+ return 0;
28
+}
0 commit comments