Samarth12's blog

By Samarth12, history, 3 years ago, In English

Hi everyone!

I would like to invite you to participate in the upcoming HackerEarth September Circuits contest. The contest will go live on September 18, 09:30 PM IST.

You will be given 7 days to solve 8 problems. The problems are prepared by me, Kritagya and Arpa. I would like to thank Arpa for coordinating the round and testing it.

The contest will be RATED. I hope you will find the problems interesting.

There are prizes for the top three competitors also:

  • First place: $100 Amazon gift card
  • Second place: $75 Amazon gift card
  • Third place: $50 Amazon gift card

Happy Coding!

Full text and comments »

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

By Samarth12, history, 3 years ago, In English

Hi all,

This is one of the problems from a hiring contest which is now over. Can someone help me in this?

Given $$$N$$$ lines, no 2 lines are collinear/parallel, none of the lines is parallel to y-axis and atmost 2 lines can intersect at a point. Clearly, these lines divide the 2-D plane into various regions. Given a single point $$$P$$$, determine the region where it belongs to.

I don't have any sample or constraints on $$$N$$$. I wrote some $$$O(N^2)$$$ solution(wrong) and it wasn't giving TLE. The only thing I could figure out after the contest was this. Can someone provide an easy and efficient solution?

Full text and comments »

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

By Samarth12, history, 3 years ago, In English

Hi everyone!

I would like to invite you to participate in the upcoming HackerEarth June DSA Contest. The contest will go live on June 12, 09:30 AM IST.

You will be given 90 minutes to solve 3 problems. All the problems are prepared by me. I would like to thank Arpa for coordinating the round and testing it.

The contest will be RATED. I hope you will find the problems interesting.

Happy Coding!

Full text and comments »

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

By Samarth12, history, 4 years ago, In English

How to solve this problem of ICPC Online round 2019: https://www.codechef.com/ICPCIN19/problems/SHUFGRID

Full text and comments »

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

By Samarth12, history, 4 years ago, In English

Suppose I have an array of positive integers and I concatenate it K times. Now I want to count the number of subarrays with sum<=S Constraints:- N<=10^5(number of elements), S<=10^5 , K <= 10^8 , 1<= A[i] <= 10^9. Any idea?

Full text and comments »

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