September Long Challenge 2019

The problems will be as difficult as the august long challenge?

It can be, it may not be, cannot be sure, first 3-4 are simple-easy then it heats up

In DIV-2, first 5 problems(and equivalently 2 in DIV-1) are quite easy, it is the 6th problem from where the fun begins.

@anon61063586 Do participate!

1 Like

what does this mean ?

The first user to solve the problems in the Long Challenge(except the Tiebreaker problem), will get 100 laddus. This is what the statement means.

1 Like

Hoping for something exciting :metal:

1 Like

Very much excited! Let’s do this. _/_

2 Likes

Let’s suppose that you are the first one in solving k problems (no other contestant got full score before you in any of those problems), then you will get 100*k laddus;

Got it Thankyou. …

Unfortunatly it is lot of math this time.
In fact, I would call only two of the A problems “programming problem”, the others are more like “math problems”.

3 Likes

This is not true at all :laughing:

1 Like

Hello, Editorials for most problems are ready , and are in verification phase. They will be released at the earliest

2 Likes

My dp solution for Chef and Interesting Subsequences :

https://www.codechef.com/viewsolution/26314531

1 Like

No need to think about DP . Very Easy Problem . You should look at this solution
here . :grinning:

2 Likes

By looking at the small constraints, brute force (dp) was the only thing that popped in my mind. :slightly_smiling_face:
I did figure out the simpler approach later…

1 Like

No need to use dp, You should check out Very Easy Solution here for Chef and Interesting Subsequences

from sys import stdin, stdout
import math

def main():
  t = int(stdin.readline())
  for _ in range(t):
    n, k = map(int, stdin.readline().split())
    a = list(map(int, stdin.readline().split()))
    a.sort()
    mx = a[k - 1]
    nn, r = 0, 0
    for i in range(k):
      if a[i] == mx:
        r += 1
    for i in range(k, n):
      if (a[i] == mx):
        nn += 1
      else:
        break
    
    nn += r
    ans = math.factorial(nn) / (math.factorial(nn - r) * math.factorial(r))
    print(int(ans))


if __name__ == "__main__":
  main()

This Solution

1 Like

Hello :slight_smile: Any ETA on DOOFST? I fear I shall explode :slight_smile:

6 Likes

Tomorrow night for sure my friend .

2 Likes

I think N \le 100 should work, but anything beyond that won’t - the people who hate everyone else cause my solution to explode :slight_smile: