Shameek's blog

By Shameek, 10 days ago, In English,

https://cses.fi/problemset/task/1160

can someone please help me in this question?

I am not getting any ideas as to how i should proceed...

Read more »

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

By Shameek, 5 weeks ago, In English,

question — Kuroni and Cowsheds

link to question — https://www.codechef.com/LTIME85A/problems/COWSHEDS

can someone please explain the solution?

I couldnt do better than Q*N basically go L to R + dsu

solution — https://www.codechef.com/viewsolution/34819303

Read more »

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

By Shameek, 5 weeks ago, In English,

We can rotate a string any number of times

We need to find the minimum possible string lexicographically.

E.g. inp — BCABDADAB op — ABBCABDAD

This is doable by Booth's algorithm in O(n).

I couldnt quite understand the way it is being done...can someone please help?

Link to algorithm

Link to complete question

Read more »

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

By Shameek, history, 7 weeks ago, In English,

Read more »

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

By Shameek, 3 months ago, In English,

my code click here im getting runtime error (SIGSEGV) on 11th testcase..why? i have also increased the SIZE significantly as people were saying in the comment section that its more than 10^5.. i dont see a reason for long long as well in the question.. can someone please help??

Read more »

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

By Shameek, history, 3 months ago, In English,

link to question

but that isnt my doubt

so sum of all coprime numbers with n upto n = sum of all numbers part of phi(n) = phi(n)*(n/2)

i wrote the code for it.. apparently my function where i do the above computation was erroneous..

i tried stresstesting...here is my codee

its not giving correct anwer from around 1650... can someone please help? my functionname is phifunc editorial is phi

(P.S. i know that using sieve its n loglog n but both the editorial and my solution are sqrt n to it)

Read more »

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