20-22 AC 23 WA

This commit is contained in:
xice09
2018-08-01 12:25:28 +08:00
parent cc6cf4cdea
commit 813bd54652
4 changed files with 92 additions and 0 deletions

31
2023WA.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
int n,m;
while (cin >> n >> m){
double *c = new double[m]{0},*i = new double[n*m]{0};
int count=0,tmp=0;
for(int ii = 0;ii<n*m;ii++){
cin >> i[ii];
c[ii%m] += i[ii];
if((ii%m == 0 && ii !=0))
(cout << setiosflags(ios::fixed) << setprecision(2) << (float)tmp/m << ' '),tmp=0;
if(ii == n*m-1){
cout << setiosflags(ios::fixed) << setprecision(2) << (float)(tmp+i[ii])/m << endl;
for(int j = 0;j<m-1;j++)
cout << (c[j] /= n) << ' ';
cout << (c[m-1] /= n) << endl;
}
tmp += i[ii];
}
for(int ii = 0;ii<n;ii++){
for(int j = 0;j<m;j++)
if(i[ii*m+j]<c[j])goto out;
count++;
out:;
}
cout << count << endl;
}
return 0;
}