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 ...
随机推荐
- 【轻院热身赛】级数求和、进制转换、candy
[题目链接:级数求和] Problem A: 级数求和 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 409 Solved: 240 SubmitSt ...
- Delphi 自带的那个 Hand 光标很难看?没关系,一行代码解决问题:
Delphi 自带的那个 Hand 光标很难看?没关系,一行代码解决问题: Screen.Cursors[crHandPoint] := LoadCursor(0, IDC_HAND);放在主窗体 O ...
- 《Python核心编程》 第三章 Python基础 - 练习
创建文件: # -*- coding: gbk -*- #! /auto/ERP/python_core/chapter ''' Created on 2014年5月21日 @author: user ...
- NGUI学习笔记-Label
属性说明 Overflow: ShrinkContent : 如果文本超出文本框宽度,会自动缩小文本size,使其显示完整 ClampContent : 文本大小固定,超出文本框的部分不会显示,也不会 ...
- 通过实验分析system_call中断处理过程
作者:吴乐 山东师范大学 <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 本实验目的:通过以一个简单的m ...
- 建立简单的VLAN通信
http://minitoo.blog.51cto.com/4201040/786011(转载) 在路由器上做单臂路由实现VLAN间路由,也就是设置子接口和封装协议. 实现环境如下图: 在交换机上建立 ...
- 利用Spring.Net技术打造可切换的分布式缓存读写类
利用Spring.Net技术打造可切换的Memcached分布式缓存读写类 Memcached是一个高性能的分布式内存对象缓存系统,因为工作在内存,读写速率比数据库高的不是一般的多,和Radis一样具 ...
- 【和我一起学python吧】python入门语法总结
1.python是一个解释性语言: 一个用编译性语言比如C或C++写的程序可以从源文件(即C或C++语言)转换到一个你的计算机使用的语言(二进制代码,即0和1).这个过程通过编译器和不同的标记.选项完 ...
- POJ-1002 解题报告
1.题目描述 http://poj.org/problem?id=1002 2.解题过程 按部就班来解题的话,这个题目很容易写出来,这是我的第一个版本的代码,思路是读入一行电话字符串,均转化为整型 ...
- dfs.datanode.max.xcievers参数导致hbase集群报错
2013/08/09 转发自http://bkeep.blog.163.com/blog/static/123414290201272644422987/ [案例]dfs.datanode.max.x ...