MotaSanyal's blog

By MotaSanyal, history, 5 years ago, In English

Hello everyone!!

Consider the Fitting Shelves Problem

The solution : We can consider all multiples of "m" less than equal to "w" to find the minimum remaining space.

My claim : We only have to consider the highest or second highest multiple of "m" to find the minimum remaining space.

Actually I have not been able to prove this but it works correctly on most of the inputs. So, any prove as to why this will work correctly or any contradictory test case that fails with this approach will be highly appreciated.

Thanks in advance :)

Full text and comments »

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

By MotaSanyal, history, 5 years ago, In English

Hello Everyone! I am stuck at this problem. I would highly appreciate if somebody explains me how the approach to this problem.

P.S. : This problem doesn't have an editorial yet.

Full text and comments »

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

By MotaSanyal, history, 5 years ago, In English

Hi everyone!

I was trying to solve this problem which came in last year ICPC Gwalior-Pune Onsite Round.

My approach :

I first checked whether C is present either in A or in B, if so, then answer will be length(A) + length(B) Otherwise , found the longest prefix of C that occurs as a suffix of A (say, X) and longest suffix of C that occurs as prefix of B (say, Y). Then if X+Y <= length(C), answer will be length(A) + length(B) + (length(C) — (X+Y)) , else if X+Y > length(C), then answer is length(A) + length(B) + (length(C) — max(X,Y)).

The verdict I am getting is Wrong Answer. Can anyone please point out where am I going wrong?

Full text and comments »

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

By MotaSanyal, history, 5 years ago, In English

Hello everyone ! It would be nice if anyone helps me with the solution to this problem — Constrained GCD Array

Problem Source — Codenation Hiring Test

Full text and comments »

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

By MotaSanyal, history, 5 years ago, In English

Hello everyone ! It would be nice if anyone helps me with the solution to this problem — Even Paths

Problem Source — Codenation Hiring Test

Full text and comments »

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

By MotaSanyal, history, 5 years ago, In English

Hello everyone. It would be nice if anyone helps me with the solution to this problem — Integer Expression

Problem Source : TCS Codevita 2018

Full text and comments »

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