samurai123's blog

By samurai123, history, 5 years ago, In English

Hello all, I am solving Problem and it is running fine in my computer. I also checked on ideone.com and there also it is giving expected output but it is giving runtime error on codeforces(Exit code is -1073741819) Submission. Can anyone help me and tell reason for this weird behavior? Thanks in advance.

Full text and comments »

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

By samurai123, 5 years ago, In English

Happy new year all. I was solving this Problem which uses idea of dp+sorting. I saw it's editorial and somewhat understood. In editorial it is mentioned that we will calculate answer by knapsack dp. Other fact mentioned in editorial is that we will always use every small items before any large items to minimize penalty. But, I have doubt that in knapsack dp,we are not considering this fact.How can we be sure that the order we took by dp will minimize penalty as we are taking some large items before some small items in dp without violating constraints? Thanks in advance.

Full text and comments »

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

By samurai123, history, 6 years ago, In English

Hello Codeforces, Can anyone help me in the Problem? There is no editorial for these round. I read others codes but it is hard to find out logic from that. Any help will be appreciated. Thanks.

Full text and comments »

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

By samurai123, history, 7 years ago, In English

I was solving SHPATH on spoj LINK. It is direct implementation of dijkstra's algorithm but my code is constantly giving runtime error. The error is always occuring when it is extracting last element from priority queue. Can anybody help and tell the reason ? LINK OF CODE

Full text and comments »

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

By samurai123, history, 7 years ago, In English

I was solving LABYR1 spoj problem LINK and the problem reduced to finding diameter of tree. But when I submitted it is constantly giving WA. Any help will be appreciated. LINK OF MY CODE

Full text and comments »

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

By samurai123, history, 7 years ago, In English

Happy new year to everyone, I was solving ACPC10D problem from spoj LINK but I am constantly getting RTE SIGSEGV while submitting. I have tried all the testcases which are mentioned in the forum and my solution gives correct output to every testcase. Then Can you help me in finding bug the code CODE? The people in the forum commented that it is not possible to solve it with top down approach. Howeever it is simple dp problem and my solution seems to be correct. So please, help me out.

Full text and comments »

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

By samurai123, history, 7 years ago, In English

Hello all, I was solving Fibosum on spoj LINK and in that the matrix is to be formed which will calculate nth fibonacci number in log(n) time. But I am not getting,what to put in entry of that matrix and how to formulate that matrix i.e.  Can anyone give steps to do in such type of problems?No resources are there on internet.

Full text and comments »

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

By samurai123, history, 7 years ago, In English

I have solved the problem LINK with sliding window. But in comments, some people mentioned about solving it with binary search. What should be the search function for binary search in the problem? Can that function be made without using concept of sliding window.

Full text and comments »

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