find the subarray with the smallest average

Правка en3, от Gi4Th4ng_Di77_NLUN, 2024-08-16 15:19:10

Hi guys, Im having a problem about the number, but I haven't solved. PLS Help me. The problem is: Given an array a (length 2e5) of positive integer numbers. Chose a subarray from L to R (1 < L <= R < n) Delete all the number from Al -> Ar. Find the min average of the left nums.

Sample INPUT (first number is int n, the n number after that is the array a) 5 5 1 7 8 2 Sample OUTPUT 2.667

Choose L = 3 R = 4 --> sum of the rest number is 5 + 1 + 2 --> average = 2.667

2 subtask: n <= 1e3 and n <= 1e5 I solve the first one, but not the latter.

Теги number, array, real number

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский Gi4Th4ng_Di77_NLUN 2024-08-16 15:29:00 11 Tiny change: 'array a)\n5\n5 1 7 8 2\nSample O' -> 'array a)\n**5** \n``\n_5 1 7 8 2_\nSample O'
en3 Английский Gi4Th4ng_Di77_NLUN 2024-08-16 15:19:10 157
en2 Английский Gi4Th4ng_Di77_NLUN 2024-08-14 19:07:11 40
en1 Английский Gi4Th4ng_Di77_NLUN 2024-08-14 19:01:47 468 Initial revision (published)