shubhsy's blog

By shubhsy, history, 5 years ago, In English

Hi! I have attempted this problem numerous times and get a Runtime Error in test case 8 with exit code -1073741819 Here is the link to the problem: http://codeforces.com/contest/1148/problem/B Here is my attempt by using two-pointers method to solve it. http://codeforces.com/contest/1148/submission/55003260 Thanks!

Full text and comments »

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

By shubhsy, history, 5 years ago, In English

I am trying to solve a problem, "Kefa and Park", https://codeforces.com/problemset/problem/580/C Here is the code I wrote and it does not give right answer for test case 12. Please, help me out. https://codeforces.com/contest/580/submission/47677278

My code builds a tree as per the question. After I build the tree, I do perform DFS. I have a stack in which I first put the first element (Root). Now, for every iteration for as long as there is an element in the stack, I check if its parent has a non zero value of number of cats in the path and if it has, I add the number of cats at that node to the upper number and if it does not, then, I switch it to the number of cats at that node. Now, if I reach the leaf and the number of consecutive cats in that path is less than or equal to the required number, I increase the number of valid paths by one.

Full text and comments »

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

By shubhsy, history, 6 years ago, In English

Here is my submission and it gives wrong answer for test case 1. It gives an answer of 8 on Codeforces when I submit and 7 when I run it on PC. Can someone help me with that? http://codeforces.com/problemset/submission/1029/42313945

Full text and comments »

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