求助

P5738 【深基7.例4】歌唱比赛

这个题不用文件输入输出吧 ~~可能~~
by FzoG @ 2022-07-08 14:20:25


你把freopen删了就过了
by flame_soul @ 2022-07-08 14:23:43


```cpp #include<bits/stdc++.h> using namespace std; int ans[100]; int main() { int n, m, maxm, minm; cin>>n>>m; int a[n][m]; for (int i=0; i<n; ++i) for (int j=0;j<m;j++) cin>>a[i][j]; for (int i=0; i<n; ++i) { maxm=-1,minm=11; for (int j=0;j<m;j++) { ans[i]+=a[i][j]; if (a[i][j]>maxm) maxm=a[i][j]; if (a[i][j]<minm) minm=a[i][j]; } ans[i]-=maxm+minm; } maxm=-1; for (int i=0;i<n;i++) if (ans[i]>maxm) maxm=ans[i]; printf("%.2f\n",maxm*1.0/(m-2)); return 0; } ```
by Walker_Sama @ 2022-07-08 14:25:37


|