Balloons Colors
题目大意:ACMer总觉得题目难度与气球的颜色有关,比如最简单的题目颜色是红色,而最难的题目是黑色的。为了让这个谣言被打破,决定添加一个约束:
气球从1到N编号
题目从1到N编号
接下来给出 N X Y。表示最简单的题目不能是X号气球,最难的不是Y号气球。
接下来给你1到N号题目的气球编号,请输出:
如果最简单的题是X号,最难的题是Y号,输出“BOTH”
如果最简单的题是X号,最难的题不是Y号,输出“EASY”
如果最简单的题不是X号,最难的题是Y号,输出“HARD”
如果最简单的题不是X号,最难的题不是Y号,输出“OKAY”
看懂题目就知道是个大水题。直接输入所有数据,判断第一个是不是X,第N个是不是Y。然后分情况输出不同结果就是了。
下面附上代码:
/*
* Problem: E
* Date: 2014-7-20
* Author: Wuhen
*/
#include <map>
#include <list>
#include <queue>
#include <string>
#include <vector>
#include <cstdarg>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#define LL long long
#define Clean(a) memset(a, 0, sizeof(a)) using namespace std; int main()
{
int T;
cin >> T;
while(T--)
{
int n, ea, ha;
cin >> n >> ea >> ha;
int temp, e = 0, m = 0;
for (int i = 1; i <= n; i++)
{
cin >> temp;
if (i == 1 && temp == ea) e = 1;
if (i == n && temp == ha) m = 1;
}
if (e && m) puts("BOTH");
else if (e && !m) puts("EASY");
else if (m && !e) puts("HARD");
else puts("OKAY");
}
return 0;
}
Balloons Colors的更多相关文章
- HNU 12826 Balloons Colors
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12826&courseid=268 #include&l ...
- hdu----149850 years, 50 colors(最小覆盖点)
50 years, 50 colors Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Othe ...
- HDU 1498 50 years, 50 colors(最小点覆盖,坑称号)
50 years, 50 colors Problem Description On Octorber 21st, HDU 50-year-celebration, 50-color balloons ...
- hdu149850 years, 50 colors (多个最小顶点覆盖)
50 years, 50 colors Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- code force 403C.C. Andryusha and Colored Balloons
C. Andryusha and Colored Balloons time limit per test 2 seconds memory limit per test 256 megabytes ...
- 50 years, 50 colors
50 years, 50 colors Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- Codeforces 782C. Andryusha and Colored Balloons 搜索
C. Andryusha and Colored Balloons time limit per test:2 seconds memory limit per test:256 megabytes ...
- hdu 1498 50 years, 50 colors 最小点覆盖
50 years, 50 colors Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Othe ...
- hdu 1498 50 years, 50 colors(二分匹配_匈牙利算法)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1498 50 years, 50 colors Time Limit: 2000/1000 MS (Ja ...
随机推荐
- MySQL修改时间函数 1.addDate(date , INTERVAL expr unit) 2.date_format(date,’%Y-%m-%d’) 3.str_to_date(date,’%Y-%m-%d’) 4.DATE_SUB(NOW(), INTERVAL 48 HOUR)
MySQL修改时间函数: 1. addDate(date,INTERVAL expr unit) interval 代表时间间隔 : SELECT NOW(); 2018-06 ...
- webpack和tree shaking和rollup
http://blog.csdn.net/haodawang/article/details/77199980 tree shaking只对es模块生效,在打包tyscript模块是要使用tsc编译器 ...
- xhr文件类型说明
2017-08-08 18:31:08 xhr : XML HTTP Request,是一种在后台与服务器进行交互的数据.这意味着可以在不加载整个网页的情况下,对网页中的部分内容进行更新. 这是Aja ...
- 探索gff/gtf格式
参考: GFF格式说明 Generic Feature Format Version 3 (GFF3) 先下载一个 gtf 文件浏览一下 1 havana gene 11869 14409 . + . ...
- ArcGIS API for Silverlight——小滑块
Widgets翻译过来是小玩具.如果使用过Dojo或者ExtJS等js框架肯定会了解到这个“小玩具”也有大用处,能够在很大程度上减少我们的工作量,快速完成功能需求.能减少多大工作量呢?让我们先来,点击 ...
- 在 Confluence 6 中的 Jira 设置
名字(Name) 输入一个有意义的服务器名字,会让你在 JIRA 服务器中更好的识别你的目录服务器: Jira Service Desk Server My Company Jira 服务器URL(S ...
- The Number Games CodeForces - 980E (树, 贪心)
链接 大意: 给定$n$节点树, 求删除$k$个节点, 使得删除后还为树, 且剩余点$\sum{2^i}$尽量大 维护一个集合$S$, 每次尽量添加最大的点即可 这样的话需要支持求点到集合的最短距离, ...
- ** exception error: no match of right hand side value
错误发生的情况是模式匹配失败.对于badmatch异常,很难找到单一的原因,但经常性的原因是你无意间尝试绑定已绑定过的变量.
- javascript里的偏函数——本质函数式编程+闭包,返回函数
最终效果: var greet = function(greeting, name) { return greeting + ' ' + name; }; var sayHelloTo = _.par ...
- 感知器、logistic与svm 区别与联系
https://blog.csdn.net/m0_37786651/article/details/61614865 从感知器谈起 对于典型的二分类问题,线性分类器的目的就是找一个超平面把正负两类分开 ...