GODOF_Shinobi's blog

By GODOF_Shinobi, history, 6 years ago, In English

This question was asked in a hiring round. As the round is over I am asking the question. Given N elements and a positive integer K divide the array into K segments/sub arrays such that maximum of sum of segments — minimum of sum of segments is minimized. Example given N=6 and K=3 a[]={7,2,3,1,2,3} .First segment is 7 ,Second is 2,3 and the Third is 1,2,3 .Max of {7,5,6} — Min of {7,5,6} = 2. While the N is pretty small. I would be thankful to any and all solutions possible.

Full text and comments »

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

By GODOF_Shinobi, history, 7 years ago, In English

This question was recently asked in Samsung "Code The Next" contest hosted on hackererth.

Boogle, the software giant developed a mobile operating system named Ambroid. As we all know, in order to unlock an Ambroid device, one needs to draw a pattern connecting the given dots. The developers of Ambroid OS want this pattern unlock to be more secure. So they are wondering, in how many ways, can we draw a pattern by connecting dots.

Given N points (dots) in the co-ordinate system, find and return the number of ways in which, we can draw a pattern by connecting dots.

A pattern is a sequence of distinct dots where two adjacent dots in the sequence are connected by a line segment and should satisfy following conditions.

  • A pattern should connect at least two dots.
  • While connecting two dots A and B, suppose there is a dot C which has not yet been connected and lies on the line segment joining A and B, then you cannot connect A and B without connecting C in between, that is, pattern A-C-B and pattern B-C-A are valid but the patterns A-B or B-A are not valid as C has not yet been connected.

Input 2<=N<=16 0<=x,y<=200

I only know the obvious n! solution. Any solution with better time complexity is appreciated.

Full text and comments »

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

By GODOF_Shinobi, history, 7 years ago, In English

Hello people on code forces , I am writing this blog from the perspective of an Engineering student . Currently I am in fifth semester ( of eight ) of my College.

As you can see from my color I still have a lot to improve in the area of CP.

I really love competitive programming and I indulge most of the time in it. I have tried my hand in other technologies like Web Development ,Data Science , Android Development , Networking but they are not my cup of tea having said that , these technologies can provide internships more easily and thus placements ( which as a student is my aim ) but I have little interest in learning them.

So few of my questions are:-

  1. How important is it to learn these technologies and should I devote my time in learning them?

  2. What role does internships and projects play in placements?

  3. Is competitive programming sufficient in itself , from a job point of view? I know companies like Facebook , Google and Amazon have interviews based on cp but what is the difficulty level there?

I would be thankful to any answers or guidance.

Full text and comments »

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

By GODOF_Shinobi, history, 8 years ago, In English

This post is regarding yesterday's problem B.

Here are two solutions 27045354 and 27019672 although being similar , one of the two solutions passed and the other had a TLE on Case 39.

I know when we try to find and delete an element which is not present in set using set.erase(set.find(x)) ,then it gives an exception as find returns an iterator that points at the end of the set.

My doubt is does this happen even if I use set.erase(x), or was this ambiguous nature?

Any help would be appreciated.

Full text and comments »

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