From a0a07a438b6804fdca0e18b2d626ceedb982611c Mon Sep 17 00:00:00 2001 From: Omar Magdy Date: Fri, 24 Jun 2022 18:33:35 +0200 Subject: Solved 4 problems on codechef long challenge --- QueueAtTheSchool/inp | 0 QueueAtTheSchool/main | Bin 0 -> 626256 bytes QueueAtTheSchool/main.cpp | 17 +++++++++++++++++ QueueAtTheSchool/main_input0.txt | 2 ++ QueueAtTheSchool/main_input1.txt | 2 ++ QueueAtTheSchool/main_input2.txt | 2 ++ QueueAtTheSchool/main_output0.txt | 1 + QueueAtTheSchool/main_output1.txt | 1 + QueueAtTheSchool/main_output2.txt | 1 + 9 files changed, 26 insertions(+) create mode 100644 QueueAtTheSchool/inp create mode 100755 QueueAtTheSchool/main create mode 100644 QueueAtTheSchool/main.cpp create mode 100644 QueueAtTheSchool/main_input0.txt create mode 100644 QueueAtTheSchool/main_input1.txt create mode 100644 QueueAtTheSchool/main_input2.txt create mode 100644 QueueAtTheSchool/main_output0.txt create mode 100644 QueueAtTheSchool/main_output1.txt create mode 100644 QueueAtTheSchool/main_output2.txt (limited to 'QueueAtTheSchool') diff --git a/QueueAtTheSchool/inp b/QueueAtTheSchool/inp new file mode 100644 index 0000000..e69de29 diff --git a/QueueAtTheSchool/main b/QueueAtTheSchool/main new file mode 100755 index 0000000..202a772 Binary files /dev/null and b/QueueAtTheSchool/main differ diff --git a/QueueAtTheSchool/main.cpp b/QueueAtTheSchool/main.cpp new file mode 100644 index 0000000..2503f26 --- /dev/null +++ b/QueueAtTheSchool/main.cpp @@ -0,0 +1,17 @@ +#include + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int n, t; + cin >> n >> t; + string s; + cin >> s; + string res; + for(int j = 0; j < t; j++) { + s = regex_replace(s, regex("BG"), "GB"); + } + cout << s << endl; +} diff --git a/QueueAtTheSchool/main_input0.txt b/QueueAtTheSchool/main_input0.txt new file mode 100644 index 0000000..7e48364 --- /dev/null +++ b/QueueAtTheSchool/main_input0.txt @@ -0,0 +1,2 @@ +5 1 +BGGBG diff --git a/QueueAtTheSchool/main_input1.txt b/QueueAtTheSchool/main_input1.txt new file mode 100644 index 0000000..c00f5b3 --- /dev/null +++ b/QueueAtTheSchool/main_input1.txt @@ -0,0 +1,2 @@ +5 2 +BGGBG diff --git a/QueueAtTheSchool/main_input2.txt b/QueueAtTheSchool/main_input2.txt new file mode 100644 index 0000000..0bf01c5 --- /dev/null +++ b/QueueAtTheSchool/main_input2.txt @@ -0,0 +1,2 @@ +4 1 +GGGB diff --git a/QueueAtTheSchool/main_output0.txt b/QueueAtTheSchool/main_output0.txt new file mode 100644 index 0000000..be65f6d --- /dev/null +++ b/QueueAtTheSchool/main_output0.txt @@ -0,0 +1 @@ +GBGGB diff --git a/QueueAtTheSchool/main_output1.txt b/QueueAtTheSchool/main_output1.txt new file mode 100644 index 0000000..5545e22 --- /dev/null +++ b/QueueAtTheSchool/main_output1.txt @@ -0,0 +1 @@ +GGBGB diff --git a/QueueAtTheSchool/main_output2.txt b/QueueAtTheSchool/main_output2.txt new file mode 100644 index 0000000..bb2a41d --- /dev/null +++ b/QueueAtTheSchool/main_output2.txt @@ -0,0 +1 @@ +GGGB -- cgit v1.2.3