杭电2023

 1 #include<stdio.h>
 2 int main()
 3 {
 4     int i,j,x,n,m,u;
 5     double a[50][5],t[5],s;
 6     while(~scanf("%d%d",&n,&m))
 7     {
 8         for(i=0; i<n; i++)
 9             for(j=0; j<m; j++)
10                 scanf("%lf",&a[i][j]);
11         for(i=0; i<n; i++)
12         {
13             for(j=0,s=0; j<m; j++)
14                 s+=a[i][j];
15             s/=m;
16             if(i)
17                 printf(" %.2lf",s);
18             else
19                 printf("%.2lf",s);
20         }
21         printf("\n");
22         for(j=0; j<m; j++)
23         {
24             for(i=0,s=0; i<n; i++)
25                 s+=a[i][j];
26             s/=n;
27             t[j]=s;
28             if(j)
29                 printf(" %.2lf",s);
30             else
31                 printf("%.2lf",s);
32         }
33         printf("\n");
34         for(i=0,x=0; i<n; i++)
35         {
36             for(j=0,u=0; j<m; j++)
37             {
38                 if(a[i][j]>=t[j])
39                     u++;
40             }
41             if(u==m)
42                 x++;
43         }
44         printf("%d\n\n",x);
45     }
46     return 0;
47 }
时间: 2024-11-05 13:32:07

杭电2023的相关文章

杭电2023 求平均成绩(及一些易见的错误)

链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=2023 首先,想说下,这题对我来说可能是一个阴影.因为在自己学校的程序竞赛中,这是第二题,当时自己没ac,结果那叫一个自卑啊!然后今天a题目的时候那种恐惧感又来了,很影响情绪.然后,自己现在完全通过自己的努力,但也用了起码3小时的纠错时间,将代码ac了.附上ac代码: #include <iostream> #include<math.h> #include <iomani

求平均成绩(杭电2023)(确实很水很繁琐)

求平均成绩 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 66221    Accepted Submission(s): 15805 Problem Description 假设一个班有n(n<=50)个学生,每人考m(m<=5)门课,求每个学生的平均成绩和每门课的平均成绩,并输出各科成绩均大于等于平均成绩的学生数量. Input

杭电2023 平均成绩

求平均成绩 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 103993    Accepted Submission(s): 24170 Problem Description 假设一个班有n(n<=50)个学生,每人考m(m<=5)门课,求每个学生的平均成绩和每门课的平均成绩,并输出各科成绩均大于等于平均成绩的学生数量. Input

杭电ACM题目分类

杭电ACM题目分类 基础题:1000.1001.1004.1005.1008.1012.1013.1014.1017.1019.1021.1028. 1029.1032.1037.1040.1048.1056.1058.1061.1070.1076.1089.1090.1091.1092. 1093.1094.1095.1096.1097.1098.1106.1108.1157.1163.1164.1170.1194.1196. 1197.1201.1202.1205.1219.1234.123

杭电 HDU 1164 Eddy&#39;s research I

Eddy's research I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7117    Accepted Submission(s): 4268 Problem Description Eddy's interest is very extensive, recently  he is interested in prime

hdu 1016 Prime Ring Problem DFS解法 纪念我在杭电的第一百题

Prime Ring Problem Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 29577    Accepted Submission(s): 13188 Problem Description A ring is compose of n circles as shown in diagram. Put natural num

杭电ACM分类

杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze 广度搜索1006 Redraiment猜想 数论:容斥定理1007 童年生活二三事 递推题1008 University 简单hash1009 目标柏林 简单模拟题1010 Rails 模拟题(堆栈)1011 Box of Bricks 简单题1012 IMMEDIATE DECODABILITY

一个人的旅行 HDU杭电2066【dijkstra算法】

http://acm.hdu.edu.cn/showproblem.php?pid=2066 Problem Description 虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景--草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女--眼看寒假就快到了,这么一大段时间,可不

杭电1162--Eddy&#39;s picture(Prim()算法)

Eddy's picture Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8070    Accepted Submission(s): 4084 Problem Description Eddy begins to like painting pictures recently ,he is sure of himself to b