杭电p2023 不知道在哪有问题有时候是Time Limit Exceeded有时是runtime error (access_violation)
求大神指点啊!!!!
#include<stdio.h>
int main()
{
int n, m;
while(scanf("%d%d", &n, &m) != EOF)
{
int sum[100][100];
int i, j;
double a[m] ;
double b[n] ;
for(i = 0; i < n; i++)
{
a[i] = 0;
for(j = 0; j < m; j++)
{
scanf("%d", &sum[i][j]);
a[i] = a[i]+sum[i][j];
}
a[i] /= m;
}
for(j = 0; j < m; j++)
{
b[j] = 0;
for(i = 0; i < n; i++)
{
b[j] += sum[i][j];
}
b[j] /= n;
}
int k = 0;
for(j = 0; j < n; j++)
{
int num = 0;
for(i = 0; i < m; i++)
{
if(sum[i][j] >= a[i])
{
num++;
}
}
if(num == m)
{
k++;
}
}
for(j = 0; j < n; j++)
{
if(j != n-1)
{
printf("%.2lf ", a[j]);
}
else
{
printf("%.2lf\n", a[j]);
}
}
for(i = 0; i < m; i++)
{
if(i != m-1)
{
printf("%.2lf ", b[i]);
}
else
{
printf("%.2lf\n", b[i]);
}
}
printf("%d\n\n", k);
}
return 0;
}
相关推荐
解决mysql ERROR 1045 (28000)-- Access denied for user问题
主要介绍了mysql ERROR 1045 (28000)-- Access denied for user解决方法,需要的朋友可以参考下
A fatal error has been detected by the Java Runtime Environment EXCEPTION_ACCESS_VIOLATION
A fatal error has been detected by the Java Runtime Environment EXCEPTION_ACCESS_VIOLATION
MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)问题的解决
第一种方法: 推荐错误描述: Mysql中添加用户之后可能出现登录时提示ERROR 1045 (28000): Access denied for user的错误. 原因分析: 在mysql.user表中可能出现user为空的记录,如: mysql> select host,user from user; +——————+——+ | host | user | +——————+——+ | % | test | | localhost | | | localhost | root | +——————+——+ 3 rows in set (0.00 sec) 解决 办法: 删除这些为空的用户或者更
ubuntu18.0.4安装mysql并解决ERROR 1698 (28000): Access denied for user ''root''@''localhost''
主要介绍了ubuntu18.0.4安装mysql并解决ERROR 1698 (28000): Access denied for user 'root'@'localhost',现在将ubuntu18.0.4上安装mysql并将碰到的问题记录下来,感兴趣的朋友一起看看吧
winxp 安装MYSQL 出现Error 1045 access denied 的解决方法
自己遇到了这个问题,也找了很久才解决,就整理一下,希望对大家有帮助!


