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 ...
随机推荐
- 【Jmeter】Linux(Mac)上使用最新版本Jmeter(5.0)做性能测试
本文我们一起来学习在Linux(Mac)上利用Jmeter进行性能测试并生成测试报告的方法. 环境准备 JDK 访问这个地址 [JDK11.01],根据实际环境下载一个JDK. Jmeter Jmet ...
- HDU 6015 Skip the Class
Skip the Class 代码: #include<bits/stdc++.h> using namespace std; #define ll long long #define l ...
- win10 自己DIY的arp绑定小脚本
@echo off&mode con cols=80 lines=22&title ARP_bind Tools setlocal enabledelayedexpansion rem ...
- luogu P2408 不同子串个数
考虑反向操作,去计算有多少组相同的子串,对于一组大小为k的极大相同子串的集合,ans-=k-1. 为了避免重复计算,需要一种有效的,有顺序的记录方案. 比如说,对于每一个相同组,按其起始点所在的位置排 ...
- 『cs231n』卷积神经网络工程实践技巧_上
概述 数据增强 思路:在训练的时候引入干扰,在测试的时候避免干扰. 翻转图片增强数据. 随机裁切图片后调整大小用于训练,测试时先图像金字塔制作不同尺寸,然后对每个尺寸在固定位置裁切固定大小进入训练,最 ...
- thinkphp中页面中时间的默认显示
1,第一我们都知道thinkphp 控制器和页面是通过$this->assgin();或着$this->在页面中要得到的值的随便变量 ,来传值的 比如(此方法是在有时间控件才能使用的) ...
- Leetcode 94
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode ...
- 此纳税人登记号已用于同一期间的交易方(交易方类型为 XXX 且交易方名称为 xxxx)。
When updated Supplier's tax informations , System occurs a error:'This tax registration number is al ...
- HTML <a> 标签的伪类
伪类的语法: selector : pseudo-class {property: value} CSS 类也可与伪类搭配使用. selector.class : pseudo-class {prop ...
- javaScript 删除确认实现方法小结
第一种: <a href="javascript:if(confirm('确认删除吗?'))window.location='del.php'">删除</a> ...