博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ACM: 限时训练题解-Epic Professor-水题
阅读量:5128 次
发布时间:2019-06-13

本文共 1655 字,大约阅读时间需要 5 分钟。

  Epic Professor

 

Dr. Bahosain works as a professor of Computer Science at HU (Hadramout    University).

 

After grading his programming exam, he noticed that most of the students have failed. Since this is the last semester for him teaching in Yemen, Dr. Bahosain decided to give bonus marks to all students in a fair way.     He decided to give the same bonus marks to all students without making the mark of any student exceed 100.

 

Help Dr. Bahosain by finding the maximum possible number of students that will pass the course after adding the bonus marks.

 

A student will pass the course if his mark after adding the bonus marks is more than or equal to 50. Input

The first line of input contains an integer T (1 ≤ T ≤   1024) that represents the number of test cases.

 

The first line of each test case contains one integer N (1 ≤ N ≤ 100) that represents the number of students in Dr. Bahosain’s class.

 

The next line contains N space-separated integers between 0 and 100, each representing the initial mark of a student.

 

Output

 

For each test case, print a single line with the maximum number of students that will pass the course.

 

 

 

Sample Input

Sample Output

2

3

5

4

0 21 83 45 64

 

7

 

99 50 46 47 48 49 98

 

/*题意教授打分,给每个同学加相同的分数,不能有超过100分的,学生达到50分就合格。问有最多有多少合格的学生。  AC代码: */ #include"iostream"#include"algorithm"#include"cstdio"#include"cstring"#include"cmath"#define MX 100 + 5using namespace std;int a[MX];bool cmp( int a,int b) {	return a>b;}int main() {	int T,n,maxx,ans;	scanf("%d",&T);	while(T--) {		maxx=0,ans=0;		scanf("%d",&n);		for(int i=0; i
=50)ans++; } printf("%d\n",ans); } return 0;}

  

 

转载于:https://www.cnblogs.com/HDMaxfun/p/5709432.html

你可能感兴趣的文章
Hexo瞎折腾系列(2) - 添加背景图片轮播
查看>>
vs------各种错误解决方法
查看>>
JavaScript基础---语言基础(3)
查看>>
团队站立会议08
查看>>
IOI1998 Polygon [区间dp]
查看>>
硬链接和符号链接的区别
查看>>
docker-swarm
查看>>
接口和抽象类
查看>>
poj2151 Check the difficulty of problems(概率dp)
查看>>
UI- UINavigationController UITabBarController 使用总结
查看>>
BZOJ3926: [Zjoi2015]诸神眷顾的幻想乡(广义后缀自动机)
查看>>
mysql 中 時間和日期函數大全
查看>>
mongodb基本语法
查看>>
[凯立德]2014全分辨率C-Car 4.0机车C2610版完美懒人包
查看>>
[LeetCode] Same Tree
查看>>
给Entity Framework添加执行的超时时间
查看>>
【总结】瞬时高并发(秒杀/活动)Redis方案(转)
查看>>
numpy模块
查看>>
iPhone图形开发绘图小结
查看>>
从零开始搭建微信硬件开发环境全过程——1小时掌握微信硬件开发流程
查看>>