Boshkash_Hates_CP's blog

By Boshkash_Hates_CP, history, 5 days ago, In English

Hello CF , First thing first , happy new year , May this year bring you health , happiness and successes in all you do !

i have struggled to understand Palindrome Pairs solution "in terms of bitmasks" , as i'm newbie.

i didn't thought about the iterative solution as it will be o(n^2) which will case TLE ,so i was trying to get a better solution and i wasn't able to , so i saw the solution which is something like this:

int main()
{
   FastIO;
   ll n ;cin >>n;
   map<ll,ll> mp;
   ll ans = 0;
   while(n--)
   {
      STR s;cin>>s;
      ll m = 0;
      for(auto x : s)
      {
         ll v = x-'a';
         m ^= (1 << v);
      }
      ans += mp[m];
      for(int x = 0 ; x < 26 ; x++)
      {
         m ^= (1 << x);
         ans += mp[m];
         m ^= (1 << x);
      }
      mp[m]++;
   }
   cout << ans;
}

i don't get it , i mean i know to check if a string is a Palindrome or not we get it's mask and check it's power of 2 or not by XOR'ing the values of each char ....help

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Boshkash_Hates_CP, history, 5 weeks ago, In English

Hello codeforces, as i have learned a new datastructure , i would like to solve some problems on it , so suggest some problems i can solve on binary search trees.

Full text and comments »

By Boshkash_Hates_CP, history, 7 weeks ago, In English

Hello , Recently i was trying to solve this problem 932B which was kinda tricky as it requires prefix sum to avoid TLE , it required 2d-prefix sum , so what's that and why i could need it , suggest some problems to get familiar with it.

Full text and comments »

By Boshkash_Hates_CP, history, 2 months ago, In English

Hello , suggest any problem (or set of problems) that can be solved using recursion and it's grid based , problems like go from s to e , or find the shortest path .... etc

Full text and comments »

  • Vote: I like it
  • +7
  • Vote: I do not like it

By Boshkash_Hates_CP, history, 2 months ago, In English

Hello codeforces , a few days ago i started learning more about recursion , and i indeed tried to solve some very basic problems on it , however , when it comes to tricky problems i cannot think how to implement a recursive function to solve the problem , another thing makes me wondring is when should i implement a recursive function and when i use the iterative function, so if anyone has some ideas about the previous questions , write it below.

thanks.

Full text and comments »

  • Vote: I like it
  • -3
  • Vote: I do not like it

By Boshkash_Hates_CP, history, 2 months ago, In English

Hello , when solving problems on binary search, i solve them because i know that i'm solving problems on Binary search topic , but if i come to a problem statement i don't know how or even if I should use binary search or not ... so my question is , how to make sure you're solving a binary search problem?

Full text and comments »

  • Vote: I like it
  • +11
  • Vote: I do not like it

By Boshkash_Hates_CP, history, 3 months ago, In English

Hello codeforces , i just have learned the backtracking technique , i want to practice and put my hands on , i want some biggener freindly problems

Full text and comments »

  • Vote: I like it
  • +9
  • Vote: I do not like it

By Boshkash_Hates_CP, history, 3 months ago, In English

Hello , Could some one please suggest a set of problems i can solve to put my hands on the "Coordinates Compression" technique ?

Full text and comments »

  • Vote: I like it
  • +4
  • Vote: I do not like it