URAL 2056 Scholarship 水题
Scholarship
Time Limit: 20 Sec
Memory Limit: 256 MB
题目连接
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=86686#problem/D
Description
- if a student has got satisfactory marks, the scholarship is not given,
- if a student has passed through the examination period with only excellent marks, he gets a personal scholarship,
- if a student doesn’t get a personal scholarship and his average mark is not less than 4.5, he gets a high scholarship,
- if a student gets neither high nor personal scholarship and doesn’t have satisfactory marks, he gets a common scholarship.
Input
The first line contains an integer n that is the number of exams (1 ≤ n ≤ 10). In the i-th of the next n lines there is an integer mi that is value of Vasya’s mark in i-th exam (3 ≤ mi ≤ 5).
Output
If Vasya doesn’t get any scholarship output “None”. If he gets a common scholarship output “Common”, if he gets a high scholarship output “High”, if he gets a personal one output “Named”.
Sample Input
3
5
5
4
Sample Output
High
HINT
题意
给n门课,如果有一门为3分,那就没有奖学金,如果所有都是5分,那就单人奖学金,如果平均分超过4.5,就High奖学金,其他就普通奖学金
题解:
水题,读完题就A了……
代码:
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define test freopen("test.txt","r",stdin)
#define maxn 20001
#define mod 1000000007
#define eps 1e-9
const int inf=0x3f3f3f3f;
const ll infll = 0x3f3f3f3f3f3f3f3fLL;
inline ll read()
{
ll x=,f=;char ch=getchar();
while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
return x*f;
}
//************************************************************************************** int a[];
int main()
{
int n=read();
int flag=;
int sum=;
for(int i=;i<n;i++)
{
cin>>a[i];
if(a[i]==)
flag=;
sum+=a[i];
}
if(flag)
{
cout<<"None"<<endl;
}
else if(sum==*n)
{
cout<<"Named"<<endl;
}
else if(sum>=4.5*(double)n)
{
cout<<"High"<<endl;
}
else
cout<<"Common"<<endl; }
URAL 2056 Scholarship 水题的更多相关文章
- DFS水题 URAL 1152 False Mirrors
题目传送门 /* 题意:一个圈,每个点有怪兽,每一次射击能消灭它左右和自己,剩余的每只怪兽攻击 搜索水题:sum记录剩余的攻击总和,tot记录承受的伤害,当伤害超过ans时,结束,算是剪枝吧 回溯写挫 ...
- URAL - 1917 Titan Ruins: Deadly Accuracy(水题)
水题一个,代码挫了一下: 题意不好理解. 你去一个洞窟内探险,洞窟内有许多宝石,但都有魔法守护,你需要用魔法将它们打下来. 每个宝石都有自己的防御等级,当你的魔法超过它的防御等级时它就会被你打下来. ...
- URAL 1136 Parliament 二叉树水题 BST后序遍历建树
二叉树水题,特别是昨天刚做完二叉树用中序后序建树,现在来做这个很快的. 跟昨天那题差不多,BST后序遍历的特型,找到最后那个数就是根,向前找,比它小的那块就是他的左儿子,比它大的那块就是右儿子,然后递 ...
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- ACM :漫漫上学路 -DP -水题
CSU 1772 漫漫上学路 Time Limit: 1000MS Memory Limit: 131072KB 64bit IO Format: %lld & %llu Submit ...
- ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)
1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 154 Solved: 112[ ...
- [poj2247] Humble Numbers (DP水题)
DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...
- gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,
1195: 相信我这是水题 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 821 Solved: 219 Description GDUT中有个风云人 ...
- BZOJ 1303 CQOI2009 中位数图 水题
1303: [CQOI2009]中位数图 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2340 Solved: 1464[Submit][Statu ...
随机推荐
- Android中FragmentPagerAdapter对Fragment的缓存(二)
上一篇我们谈到了,当应用程序恢复时,由于FragmentPagerAdapter对Fragment进行了缓存的读取,导致其并未使用在Activity中新创建的Fragment实例.今天我们来看如何解决 ...
- IP网络5种基本寻址方式 (单播、多播、广播、任播、地域多播)
Addressing methods The Internet Protocol and other network addressing systems recognize five main ad ...
- git push冲突解决
1. 首先,可以试图用git push origin branch-name推送自己的修改:2. 如果推送失败,则因为远程分支比你的本地更新,需要先用git pull试图合并:如果git pull提示 ...
- Dropping water balloons
题意: 给你k个水球n层楼(n很大) 现在做实验在楼上向下丢水球,若水球没破可以重新丢,求把所有水球弄破的最小试验次数. 分析: 开始完全没思路啊.从正面求没法做不会表示状态,做实验是只能从第一层,一 ...
- extjs form submit 总是执行failure
代码: function createWeekReort() { if (form.getForm().isValid()) { Ext.Msg.confirm("提示", &qu ...
- 《Python基础教程(第二版)》学习笔记 -> 第十章 充电时刻 之 标准库
SYS sys这个模块让你能够访问与Python解释器联系紧密的变量和函数,下面是一些sys模块中重要的函数和变量: 函数和变量 描述 argv 命令行参数,包括脚本和名称 exit([arg]) ...
- sql语句中获取datetime任何部分
sql语句中获取datetime的日期部分 sql语句中 经常操作操作datetime类型数据.今天在写一个存储过程的时候需要将 一个datetime的值的 日期部分提取出来.网上有许多这方面的介绍. ...
- BufferedReader和BufferedWriter读写文件(转载)
http://375940084.blog.51cto.com/2581965/751040 1.创建Student类存储每个学生信息,属性(学号,姓名,出生日期,得分)2.从c:/test/stud ...
- res/raw和assets的 区别
res/raw和assets的相同点: 两者目录下的文件在打包后会原封不动的保存在apk包中,不会被编译成二进制. res/raw和assets的不同点: 1.res/raw中的文件会被映射到R.ja ...
- quotation
1. 如果不能修心,则诸事繁杂!; 2. 人生,是该追求平淡长久,还是绚烂短暂,我想人人都有自己的答案,但阅历或者情感,都不是越多越好,烂桃三筐不如鲜杏一个,是古老的俗话,却至今鲜活有力.以量取胜,实 ...