aboutsummaryrefslogtreecommitdiff
path: root/codechef/SnakeProcession
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/SnakeProcession
parent4688ed5f3a56ac6698250e2169adbfbe53b8b685 (diff)
downloadcompetitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.tar.xz
competitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.zip
Solved some new problems
Diffstat (limited to 'codechef/SnakeProcession')
-rw-r--r--codechef/SnakeProcession/inp0
-rwxr-xr-xcodechef/SnakeProcession/mainbin0 -> 604248 bytes
-rw-r--r--codechef/SnakeProcession/main.cpp18
-rw-r--r--codechef/SnakeProcession/main_input0.txt13
-rw-r--r--codechef/SnakeProcession/main_output0.txt6
5 files changed, 37 insertions, 0 deletions
diff --git a/codechef/SnakeProcession/inp b/codechef/SnakeProcession/inp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/codechef/SnakeProcession/inp
diff --git a/codechef/SnakeProcession/main b/codechef/SnakeProcession/main
new file mode 100755
index 0000000..08fed83
--- /dev/null
+++ b/codechef/SnakeProcession/main
Binary files differ
diff --git a/codechef/SnakeProcession/main.cpp b/codechef/SnakeProcession/main.cpp
new file mode 100644
index 0000000..cad706e
--- /dev/null
+++ b/codechef/SnakeProcession/main.cpp
@@ -0,0 +1,18 @@
+#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;
+ cin >> n;
+ string s;
+ cin >> s;
+ bool ans = regex_match(s, regex("(\\.*H\\.*T\\.*)*|(\\.*)"));
+ cout << (ans ? "Valid" : "Invalid") << endl;
+ }
+}
diff --git a/codechef/SnakeProcession/main_input0.txt b/codechef/SnakeProcession/main_input0.txt
new file mode 100644
index 0000000..54c49dc
--- /dev/null
+++ b/codechef/SnakeProcession/main_input0.txt
@@ -0,0 +1,13 @@
+6
+18
+..H..T...HTH....T.
+3
+...
+10
+H..H..T..T
+2
+HT
+11
+.T...H..H.T
+7
+H..T..H
diff --git a/codechef/SnakeProcession/main_output0.txt b/codechef/SnakeProcession/main_output0.txt
new file mode 100644
index 0000000..cde65af
--- /dev/null
+++ b/codechef/SnakeProcession/main_output0.txt
@@ -0,0 +1,6 @@
+Valid
+Valid
+Invalid
+Valid
+Invalid
+Invalid