1 solutions

  • 0
    @ 2023-1-21 17:01:48
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int i, j, x, n, sum = 0, a[10010];
    	cin >> n >> x;
    	for(i = 1; i <= n; i++)
    		cin >> a[i];
    	for(i = 1; i <= n; i++)
    		for(j = 1; j <= n-i; j++)
    			if(a[j] > a[j+1])
    				swap(a[j],a[j+1]);
    	for(i = x+1; i <= n-x; i++)
    		sum += a[i];
    	cout << fixed << setprecision(1)<<(sum*1.0)/(n-x*2)<< endl;
    	return 0;
    }
    
    
    
    • 1

    Information

    ID
    810
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    10
    Tags
    # Submissions
    1
    Accepted
    1
    Uploaded By