jugal_sahu's blog

By jugal_sahu, history, 9 years ago, In English

Please somebody give me good links to learn fft. Thanks.

Full text and comments »

Tags fft
  • Vote: I like it
  • +6
  • Vote: I do not like it

By jugal_sahu, history, 9 years ago, In English

Hi! I am unable to find why my code is giving memory limit exceeded? Please can someone help......? my code: 12828787

Full text and comments »

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

By jugal_sahu, history, 9 years ago, In English

Hi! I was trying to learn Edmond's Blossom algorithm.I learned something from wikipedia and other source but i didn't find c++ implementation of it.Please provide me link where i can understand it's implementation properly. Thanks.

Full text and comments »

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

By jugal_sahu, history, 9 years ago, In English

I was reading editorial editorial for problem here.There was a problem link here and editorial for that here. I got what is written in editorial but don't know why that works.Can anybody comment on correctness of algorithm.thanks.

Full text and comments »

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

By jugal_sahu, history, 10 years ago, In English

I was trying to solve this problem using trie i even implemented it and tested for some cases but when submitted got wrong answer.Can anybody find bug in my code or tell me another way to do it. Thanks problem link :here c++ code : here

Full text and comments »

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

By jugal_sahu, history, 10 years ago, In English

I was trying to solve this problem using top down dp but got tle.I read from comment that bottom up gives ac.But i am unable to implement bottom up dp.Please help.Thanks. Problem link: here My code link: here

Full text and comments »

Tags dp
  • Vote: I like it
  • +5
  • Vote: I do not like it

By jugal_sahu, history, 10 years ago, In English

I was trying to solve TAXI problem on spoj link here But don't know where my code is going wrong. Please help .Thanks. here is my code : link here

Full text and comments »

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

By jugal_sahu, history, 10 years ago, In English

I was trying to solve fake tournament problem on spoj but i was unable to come up with any solution. Can anyone give me hint.Thanks.

problem link: here

Full text and comments »

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

By jugal_sahu, 10 years ago, In English

i am trying to solve maxflow problem link:link but getting wrong answer... please help.. my code link

Full text and comments »

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

By jugal_sahu, 10 years ago, In English

problem link : link

I have already solved distinct substring (spoj : link) but new distinct substring have strict timelimit.Please give me hint.....thanks

Full text and comments »

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

By jugal_sahu, 10 years ago, In English

Can anyone help ? why i am getting wrong answer ? please give me test cases where my code is giving wrong answer.... "Thanks in advance".

Problem link My code

Full text and comments »

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

By jugal_sahu, 10 years ago, In English

Problem Link

I was trying to solve Distinct Substrings on spoj.I know it can be solved using Suffix Array But I think it can also be solved using Trie......here is my solution which is getting SIGSEGV (don't know why).Please tell me where i am wrong.

My C++ code

what i did: for string ABABABB taking substring of it : ABABABB BABABB ABABB BABB ABB BB B putting it into Trie one by one.Whenever new character is inserted count is increased by one. Each node has 26 child.

Can anybody tell me why i am getting SIGSEGV. Thanks in Advance... :)

Full text and comments »

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

By jugal_sahu, 10 years ago, In English

I don't know why i am getting wrong answer......please anyone help.... problem link :here my code is : here

Full text and comments »

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

By jugal_sahu, 10 years ago, In English

I was trying to solve D-query here problem on spoj.I searched for the solution and found one blog here and solution here.I got accepted.But the problem is that when i am sorting queries using qsort function it's giving tle.

when i am using this with sort function it's fine

bool cmp(node x, node y) { if(x.x/BLOCK != y.x/BLOCK) { return x.x/BLOCK < y.x/BLOCK; } return x.y < y.y; }

but when i am using this with qsort it's giving tle

int inline cmp(const void *xx,const void *yy) { nod *x = (nod *) xx; nod *y = (nod *) yy; if(x->x!=y->x) return (x->x>y->x)?1:-1; return (x->y>y->y)?1:(x->yy)?-1:0; }

my code is here

Please any one give me answer why is this happening....thanks in advance

Full text and comments »

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

By jugal_sahu, 10 years ago, In English

I was trying to solve COUNT(spoj problem).I am able to solve it using 3D DP but it will give segmentation fault because of the constraints.Can anyone help?

Full text and comments »

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

By jugal_sahu, 10 years ago, In English

I was trying to solve this problem . I even searched for solution but was unable to understand .Can any one explain how to solve it.

Full text and comments »

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

By jugal_sahu, 10 years ago, In English

Activities — SPOJ . I was trying to solve this problem using dp + binary search but got tle. Can anyone give me idea to solve it.

Full text and comments »

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

By jugal_sahu, 10 years ago, In English

I am unable to find where my code is going wrong.First i calculated LCS of string and it's reverse than printed ans=length of string — LCS.

Can anyone tell me where i am wrong . my code is : here

Full text and comments »

Tags dp, lcs
  • Vote: I like it
  • 0
  • Vote: I do not like it