New problem on Probability
Practice
1.7 (6 votes)
Medium
Problem
84% Success 1190 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Mayank is given an array named as K and the size of the array is L , and given a number âTâ such that he has to choose randomly maximum two numbers, X and Y such that 0 <= X < Y< L.
What is the probability that sum{K[X]...K[Y] } <= T }?
Input Format:
The first line will contain two numbers: L and T. L lines follow, each containing one number from the array K.
Output Format:
Output one number P to a maximum of 8 decimal places, the probability that sum{K[X],... k[Y]} <= T}
Constraints:
1 <= N < 100000 0 <= D[i] < 10^7
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
9 votes
Tags:
MathematicsMediumProbablityBasic ProbabilityProbability
Points:30
13 votes
Tags:
Dynamic ProgrammingBasic ProbabilityBrute ForceAlgorithmsProbablityMath
Editorial
No editorial available for this problem.