Cut-off shouldn't be very high. Last year everyone was selected as many people faced problems with their computer systems.

Active In

Competitive Programming

Algorithms and Data Structures

Featured Contributions

reply in this discussion

Rishik Sood45w

Cut-off shouldn't be very high. Last year everyone was selected as many people faced problems with their computer systems.

Read more… (19 words)

reply in this discussion

Rishik Sood45w

Zco 2018 questions:

1) You have C cakes and N children. Each child has a range between Si and Ei inclusive. A child will eat all the cakes lying between the range. Let's say you have 5 cakes, and the range of 2 kids are [2,2] and [2,5], then the kids will fight over the second cake. To avoid this you are allowed to move at max one child from its place and allot him another range. If you can remove all the clashes by shifting 1 child then print Good, otherwise print Bad.

2) You have string consisting of X, Y and Z. A string is good if it starts with X, ends with Y and has a length divisible by 3.

The importance of a string is the number of good string it intersects with.

Given the string and a length k, find a string of length k and minimum importance. You have to print its importance.

Read more… (159 words)

reply in this discussion

reply in this discussion

Rishik Sood45w

mina hold the lower bound of the set whereas minb holds the upper bound of the set

Read more… (17 words)

reply in this discussion

reply in this discussion

Rishik Sood45w

n = input()l = []for i in xrange(n):a,b = map(int,raw_input().split())l.append((a,b))l.sort()minia = l[0][0]minib = l[0][1]ans = 1for i in xrange(1,n):if l[i][0] <= minib and l[i][1] >= minib:#start within but ends outside our rangeminia = l[i][0]elif l[i][0] > minib:#disjoint setminia = l[i][0]minib = l[i][1]ans += 1elif l[i][1] <= minib:#when subset lies in between our range

Read more…