ryoko1's blog

By ryoko1, history, 7 years ago, In English

Here is the link to the problem : Your text to link here... The problem tag says that it is a math related problem,but I am not able to find the logic behind it. I did find a solution on geeksforgeeks for a similar type of problem but the implementation seems a bit vague since there is no explanation provided as to how the logic was deduced. Here is the link for gfg sol : Your text to link here... It would be of great help if someone could explain me the logic behind this solution.

Full text and comments »

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

By ryoko1, 7 years ago, In English

Here is the link for the problem:(http://www.spoj.com/problems/HISTOGRA/) Here is my solution:(http://ideone.com/6SkfuH). The code is giving wrong output for the example mentioned in the solution link.The right answer for that test case is 283960245. I tried to debug my code and I think that the stack is not popping the value at i=2.I maybe wrong here,I am just not sure.Your help will be appreciated.

Full text and comments »

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

By ryoko1, history, 7 years ago, In English

the problem tag is: 796B - Найти кость Here is my sol: 26520634. Another query is that in the above submission when I change my array size from (n+1) to max the OJ gives me TLE on 5th test case. Why is it so? According to my knowledge array creation is a O(1) process and should not affect the time complexity of the program by any means. Your help will be appreciated!!!

Full text and comments »

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

By ryoko1, history, 7 years ago, In English

Here is my code: 26360123`

I am getting the output as : Runtime error: exit code is -1073741819 Your help will be appreciated!!

Full text and comments »

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