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 ...
随机推荐
- SSH Secure Shell Client--- the host may be dow
the host may be down,or there may be a problem with the network connection. Sometimes such problems ...
- 新概念 Lesson 3 Nice to meet you
Nice to meet you. 你好 打招呼: hi,hello 重点: 打招呼和互相介绍.主系表结构 Is Chang-woo Chinese? 昌武是中国人吗? No,he isn't . H ...
- inputsimulator - Windows Input Simulator
窗体输入模拟器提供一个基于 win32 SendInput 方法的 模拟键盘鼠标输入的.net 接口.windows 输入模拟器可用于 WPF.windows 窗体和控制台应用程序, 实现模拟任意按 ...
- codeforces 536a//Tavas and Karafs// Codeforces Round #299(Div. 1)
题意:一个等差数列,首项为a,公差为b,无限长.操作cz是区间里选择最多m个不同的非0元素减1,最多操作t次,现给出区间左端ll,在t次操作能使区间全为0的情况下,问右端最大为多少. 这么一个简单题吞 ...
- Enter键实现按钮相同功能
1.在所在的按钮(Enter键功能)的容器上加上onkeydown="saveForKeyDown()",通常加载body上 <!-- 添加窗口--> <div ...
- Sonya and Ice Cream CodeForces - 1004E 树的直径, 贪心
题目链接 set维护最小值贪心, 刚开始用树的直径+单调队列没调出来... #include <iostream>#include <cstdio> #include < ...
- C++中的初始化参数列表
c++中以下几种情况的变量的初始化不可以写在构造函数里,而是要写在初始化参数列表中 1.const常量 class AA { public : const int num; public : AA() ...
- 主席树学习笔记-hdu-2665
主席树就是对每个历史版本都建了一颗线段树,这样我们在统计一些问题的时候,对于一个区间[L,R]的询问,就可以利用前缀和的思想找到第L-1和第R颗历史版本的线段树来处理查找.由于这样空间需求就增大了,注 ...
- hdu2059 dpdpdp玄学5555~~
龟兔赛跑 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- Activiti工作流笔记(4)
Activiti工作流启动流程 /** * 启动流程 * */ public class ActivitiTest2 { RepositoryService repositoryService; Ru ...