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.
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.
Hoping for something exciting
Very much excited! Let’s do this. _/_
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”.
This is not true at all
Hello, Editorials for most problems are ready , and are in verification phase. They will be released at the earliest
By looking at the small constraints, brute force (dp) was the only thing that popped in my mind.
I did figure out the simpler approach later…
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()
Tomorrow night for sure my friend .
I think N \le 100 should work, but anything beyond that won’t - the people who hate everyone else cause my solution to explode