aboutsummaryrefslogtreecommitdiff
path: root/codechef/ChefAndFeedBack
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2022-07-08 19:54:42 +0200
committeromagdy7 <omar.professional8777@gmail.com>2022-07-08 19:54:42 +0200
commitdd684349c67c988ef19707cb65e637b6906fac75 (patch)
tree2fd9ac45ef08351c8164eda640dade2890f4c731 /codechef/ChefAndFeedBack
parent4688ed5f3a56ac6698250e2169adbfbe53b8b685 (diff)
downloadcompetitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.tar.xz
competitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.zip
Solved some new problems
Diffstat (limited to 'codechef/ChefAndFeedBack')
-rw-r--r--codechef/ChefAndFeedBack/inp0
-rwxr-xr-xcodechef/ChefAndFeedBack/mainbin0 -> 30544 bytes
-rw-r--r--codechef/ChefAndFeedBack/main.cpp24
-rw-r--r--codechef/ChefAndFeedBack/main.py8
-rw-r--r--codechef/ChefAndFeedBack/main_input0.txt3
-rw-r--r--codechef/ChefAndFeedBack/main_output0.txt2
6 files changed, 37 insertions, 0 deletions
diff --git a/codechef/ChefAndFeedBack/inp b/codechef/ChefAndFeedBack/inp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/codechef/ChefAndFeedBack/inp
diff --git a/codechef/ChefAndFeedBack/main b/codechef/ChefAndFeedBack/main
new file mode 100755
index 0000000..c3c70a2
--- /dev/null
+++ b/codechef/ChefAndFeedBack/main
Binary files differ
diff --git a/codechef/ChefAndFeedBack/main.cpp b/codechef/ChefAndFeedBack/main.cpp
new file mode 100644
index 0000000..8f04fc8
--- /dev/null
+++ b/codechef/ChefAndFeedBack/main.cpp
@@ -0,0 +1,24 @@
+#include<bits/stdc++.h>
+
+
+using namespace std;
+
+int main () {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ string str1 = "010";
+ string str2 = "101";
+ while(tt--){
+ string s;
+ cin >> s;
+ int found1 = s.find(str1);
+ int found2 = s.find(str2);
+ if(found1 != string::npos || found2 != string::npos) {
+ cout << "Good" << endl;
+ } else {
+ cout << "Bad" << endl;
+ }
+ }
+}
diff --git a/codechef/ChefAndFeedBack/main.py b/codechef/ChefAndFeedBack/main.py
new file mode 100644
index 0000000..afde99f
--- /dev/null
+++ b/codechef/ChefAndFeedBack/main.py
@@ -0,0 +1,8 @@
+t = int(input())
+for i in range(t):
+ s = input()
+ if "101" in s or "010" in s:
+ print("Good")
+ else:
+ print("Bad")
+
diff --git a/codechef/ChefAndFeedBack/main_input0.txt b/codechef/ChefAndFeedBack/main_input0.txt
new file mode 100644
index 0000000..16405d6
--- /dev/null
+++ b/codechef/ChefAndFeedBack/main_input0.txt
@@ -0,0 +1,3 @@
+2
+11111110
+10101010101010
diff --git a/codechef/ChefAndFeedBack/main_output0.txt b/codechef/ChefAndFeedBack/main_output0.txt
new file mode 100644
index 0000000..c985d56
--- /dev/null
+++ b/codechef/ChefAndFeedBack/main_output0.txt
@@ -0,0 +1,2 @@
+Bad
+Good