aboutsummaryrefslogtreecommitdiff
path: root/codechef/HiringTest/main.cpp
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/HiringTest/main.cpp
parent4688ed5f3a56ac6698250e2169adbfbe53b8b685 (diff)
downloadcompetitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.tar.xz
competitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.zip
Solved some new problems
Diffstat (limited to 'codechef/HiringTest/main.cpp')
-rw-r--r--codechef/HiringTest/main.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/codechef/HiringTest/main.cpp b/codechef/HiringTest/main.cpp
new file mode 100644
index 0000000..e5a08a8
--- /dev/null
+++ b/codechef/HiringTest/main.cpp
@@ -0,0 +1,27 @@
+#include<bits/stdc++.h>
+
+using namespace std;
+
+int main () {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ while(tt--){
+ int n, m, x, y;
+ cin >> n >> m >> x >> y;
+ string ans = "";
+ for(int i = 0; i < n; i++) {
+ string pb;
+ cin >> pb;
+ int f = count(pb.begin(), pb.end(), 'F');
+ int p = count(pb.begin(), pb.end(), 'P');
+ if(f >= x || f == x - 1 && p >= y) {
+ ans.push_back('1');
+ } else {
+ ans.push_back('0');
+ }
+ }
+ cout << ans << endl;
+ }
+}