ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#205719 | #3696. 打分 | Xieyunlong | 100 | 1ms | 1308kb | C++11 | 403b | 2024-07-19 18:03:06 | 2024-07-19 20:06:47 |
answer
#include<bits/stdc++.h>
using namespace std;
int n;
double pj=0,mx=-1,sm=0;
double a[350];/*19260817*/
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}
sort(a+1,a+n+1);
for(int i=2;i<=n-1;i++){
sm+=a[i];
}
pj=sm/(n-2);
for(int i=2;i<=n-1;i++){
if(abs(a[i]-pj)>mx){
mx=abs(a[i]-pj);
}
}
printf("%.2f %.2f",pj,mx);
//cout<<pj<<" "<<mx;
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 5
Accepted
time: 0ms
memory: 1304kb
input:
3 6.5 12.5 2.8
output:
6.50 0.00
result:
ok single line: '6.50 0.00'
Test #2:
score: 5
Accepted
time: 0ms
memory: 1308kb
input:
5 13.3 1.7 10.8 12.4 6.7
output:
9.97 3.27
result:
ok single line: '9.97 3.27'
Test #3:
score: 5
Accepted
time: 0ms
memory: 1304kb
input:
8 13.0 4.3 19.8 14.0 10.8 8.8 12.2 19.5
output:
13.05 6.45
result:
ok single line: '13.05 6.45'
Test #4:
score: 5
Accepted
time: 0ms
memory: 1308kb
input:
10 5.0 16.0 4.5 11.4 7.9 5.7 18.9 5.9 19.6 4.0
output:
9.41 9.49
result:
ok single line: '9.41 9.49'
Test #5:
score: 5
Accepted
time: 0ms
memory: 1304kb
input:
13 224.7 476.6 173.0 33.6 109.7 335.2 477.4 480.5 454.3 115.8 66.3 470.0 268.6
output:
288.33 222.03
result:
ok single line: '288.33 222.03'
Test #6:
score: 5
Accepted
time: 0ms
memory: 1308kb
input:
12 409.7 486.2 310.9 22.9 499.0 32.3 149.1 366.4 314.3 28.9 280.5 167.3
output:
254.56 231.64
result:
ok single line: '254.56 231.64'
Test #7:
score: 5
Accepted
time: 0ms
memory: 1308kb
input:
22 64.8 358.2 46.3 8.4 211.4 203.2 435.2 285.2 471.8 196.7 2.2 287.0 431.2 4.5 479.9 77.8 436.6 157....
output:
230.73 241.07
result:
ok single line: '230.73 241.07'
Test #8:
score: 5
Accepted
time: 1ms
memory: 1308kb
input:
48 208.0 233.5 10.6 496.8 442.8 71.4 350.4 358.8 307.9 191.9 42.9 222.2 129.5 189.6 126.2 234.2 473....
output:
251.25 239.95
result:
ok single line: '251.25 239.95'
Test #9:
score: 5
Accepted
time: 0ms
memory: 1308kb
input:
78 65701.6 82237.5 62279.3 40356.4 17379.3 69705.3 16922.4 91857.9 58801.5 79897.8 14176.5 7230.4 17...
output:
53206.26 49176.96
result:
ok single line: '53206.26 49176.96'
Test #10:
score: 5
Accepted
time: 0ms
memory: 1304kb
input:
79 42244.6 81054.6 44916.3 38525.3 54197.5 53017.7 17302.8 10893.2 56458.0 85050.3 82785.0 69278.5 8...
output:
52859.70 46258.30
result:
ok single line: '52859.70 46258.30'
Test #11:
score: 5
Accepted
time: 0ms
memory: 1308kb
input:
81 36951.0 78160.7 6155.7 94546.5 94303.1 18561.1 81053.6 12198.7 36138.8 40528.1 18133.2 82460.8 45...
output:
48080.21 49194.89
result:
ok single line: '48080.21 49194.89'
Test #12:
score: 5
Accepted
time: 0ms
memory: 1308kb
input:
64 38783.1 99085.0 68327.0 61820.6 96923.9 96266.5 10145.2 79991.6 18193.0 39484.6 85678.3 25619.6 5...
output:
47005.80 50642.90
result:
ok single line: '47005.80 50642.90'
Test #13:
score: 5
Accepted
time: 0ms
memory: 1308kb
input:
277 826955.8 32309.8 345627.4 605828.4 551299.8 332329.5 708916.3 42849.9 752247.3 581677.5 60037.6 ...
output:
495587.49 503174.11
result:
ok single line: '495587.49 503174.11'
Test #14:
score: 5
Accepted
time: 0ms
memory: 1308kb
input:
147 100946.4 207512.7 458341.3 543902.4 168834.9 857664.9 597540.1 2087.2 425605.0 12872.5 742652.7 ...
output:
515225.38 513138.18
result:
ok single line: '515225.38 513138.18'
Test #15:
score: 5
Accepted
time: 0ms
memory: 1308kb
input:
213 491179.3 531637.0 313251.7 313581.3 341530.1 398086.5 552510.7 827480.3 61108.3 899174.6 939109....
output:
533980.36 525092.26
result:
ok single line: '533980.36 525092.26'
Test #16:
score: 5
Accepted
time: 0ms
memory: 1304kb
input:
135 777185.7 972343.6 62940.3 321840.8 271508.3 134016.3 609887.6 344163.3 843555.1 488463.5 363934....
output:
504211.34 478514.96
result:
ok single line: '504211.34 478514.96'
Test #17:
score: 5
Accepted
time: 0ms
memory: 1304kb
input:
295 4246472.7 2050549.1 1393628.6 1690980.8 8010352.6 5843427.7 1063451.1 7642299.6 9999927.0 181015...
output:
5137578.41 5074939.51
result:
ok single line: '5137578.41 5074939.51'
Test #18:
score: 5
Accepted
time: 0ms
memory: 1304kb
input:
297 3091394.2 3061828.5 6037364.3 6338661.2 7622400.2 7545583.8 8784337.4 6695456.7 4970122.0 736602...
output:
5198786.33 5127934.83
result:
ok single line: '5198786.33 5127934.83'
Test #19:
score: 5
Accepted
time: 0ms
memory: 1304kb
input:
300 1597492.6 8696604.8 1757401.0 3848419.9 6412994.7 3122146.6 8902877.2 9344863.5 8884009.0 674040...
output:
5054519.32 4941336.62
result:
ok single line: '5054519.32 4941336.62'
Test #20:
score: 5
Accepted
time: 0ms
memory: 1308kb
input:
300 7897163.8 3075022.4 7236700.2 2476749.9 5823952.6 2042155.9 1152091.2 8918332.9 7756900.8 130700...
output:
5068881.74 4983549.94
result:
ok single line: '5068881.74 4983549.94'