From b4d8790fe6311127164141ec5557b1e1a683b98c Mon Sep 17 00:00:00 2001 From: Saurabh Singh <96985651+SaurabhSingh720@users.noreply.github.com> Date: Wed, 12 Oct 2022 12:08:59 +0530 Subject: [PATCH 1/2] binary_string.cpp this this my code of codechef for binary string problem. --- CPP/binaray_sting.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 CPP/binaray_sting.cpp diff --git a/CPP/binaray_sting.cpp b/CPP/binaray_sting.cpp new file mode 100644 index 0000000..c0ff3b4 --- /dev/null +++ b/CPP/binaray_sting.cpp @@ -0,0 +1,32 @@ +//link:https://www.codechef.com/OCT221D/problems/BINARYSUB + +#include + +using namespace std; +int main(){ + + long long int test; + cin >> test; + for(int j=0;j> substr; + + long long int sz=substr.size(); + long long int ar1[sz+1]; + ar1[sz]=1; + ar1[sz-1]=1; + for(int i=sz-2 ; i>=0 ; i--) + { + if(substr[i]!=substr[i+1]){ + ar1[i] = ( ar1[i+2] + ar1[i+1] ) % 998244353; + } + + else{ + + ar1[i]=ar1[i+1]; + } + } + + cout< Date: Wed, 12 Oct 2022 12:50:34 +0530 Subject: [PATCH 2/2] conditional_problem.cpp This is problem on codechef related to topic conditional statements. --- CPP/conditional_problem.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CPP/conditional_problem.cpp diff --git a/CPP/conditional_problem.cpp b/CPP/conditional_problem.cpp new file mode 100644 index 0000000..3bf9f69 --- /dev/null +++ b/CPP/conditional_problem.cpp @@ -0,0 +1,21 @@ +//link: https://www.codechef.com/START59D/problems/SPECIALITY + +#include +using namespace std; + +int main() { + int n; + cin>>n; + for(int i=0;i>s>>t>>e; + if(s>t && s>e) + cout<<"Setter"<s && t>e) + cout<<"Tester"<