In such a short time you explained all the questions well with implementation keep it short 😊 less time more productivity
thank you bhaiya
Great bro i have given on div 3 3 hi hue the how can i improve?
My rating is 1050 , and I can do only first two questions, how can I uplift my skills
Good evening sir,, i am a newbie at codeforce,(813),, from last 4 contest my ratings are decreasing rapidly,, i am not able to solve more than 1 question in div 2 and 3 ,, and barely solve 1-2 questions on div 4 ,,, i know stl but can't implement it,, i mean i am not able to judge after reading the question ki mujhe map use karna hai ki set aur,,, agar pata chl bhi jaye to pura implement nhi kar pata hun.. Please give some tips,, like some kind of practice set i should do.?
#include
using namespace std;
vectorpows(300005);
int h(string s){
int has=0;
int mod=1e9+7;
int j=0;
for(int i=s.size()-1;i>=0;i--){
has=(has+(s[i]-'a'+1)*(pows[j]))%mod;
j++;
}
return has;
}
int main() {
// your code goes here
int mod=1e9+7;
int p = 331;
pows[0] = 1;
for (int i = 1; i < 300005; i++)
{
pows[i] = (pows[i - 1] * p) % mod;
}
int t;
cin>>t;
while(t--){
string s;
cin>>s;
int n=s.size();
int ans=0;
if(n%2==1){
cout
Please speak in english bro
Sir please please help me with this for fifth question giving run time error
I do not know string hashing so i use 3 vectors that store prefix strting suffix string and the current string with length n/2. Giving. Run time error on 5 th hidden test case . Took more than 5 hour
#include
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
string s;
cin>>s;
int ans=0;
int n=s.length();
if(n%2!=0) ans=0;
else{
int x=n/2;
vectorprefix(n),suffix(n),mera(n);
for(int i=0;i=0)
prefix[i]=prefix[i-1]+s[i];
else prefix[i]=s[0];
}
for(int i=n-1;i>=0;i--){
if(i
You are accessing i - 1 when your for loop starts with i = 0. And also i + 1 when i = n - 1.
@@CloudProgrammer-jc6ku sir i did not get it in which line . i have used pre conditiono in every edge case (i>0) it wont go for 0 and i
Thanks a lot for ur efforts ❤