20-22 AC 23 WA
This commit is contained in:
31
2023WA.cpp
Normal file
31
2023WA.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user