HDU 1939 HE IS OFFSIDE
He is offside!
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 538 Accepted Submission(s):
333
Tumbolia, a small country located east of South America (or south of East
America). The most popular sport in Tumbolia, unsurprisingly, is soccer; many
games are broadcast every week in Tumbolia.
Hemisphere Network receives
many requests to replay dubious plays; usually, these happen when a player is
deemed to be offside by the referee. An attacking player is offside if he is
nearer to his opponents' goal line than the second last opponent. A player is
not offside if
●he is level with the second last opponent or
●he is level
with the last two opponents.
Through the use of computer graphics
technology, Hemisphere Network can take an image of the field and determine the
distances of the players to the defending team's goal line, but they still need
a program that, given these distances, decides whether a player is
offside.
line of each test case contains two integers A and D separated by a single space
indicating, respectively, the number of attacking and defending players involved
in the play (2 <= A,D <= 11). The next line contains A integers Bi
separated by single spaces, indicating the distances of the attacking players to
the goal line
(1 <= Bi <= 104). The next line contains D
integers Cj separated by single spaces, indicating the distances of the
defending players to the goal line (1 <= Cj <= 104). The end of
input is indicated by A = D = 0.
a single character: "Y"(uppercase) if there is an attacking player offside, and
"N"(uppercase) otherwise.
500 700
700 500 500
2 2
200 400
200 1000
3 4
530 510 490
480 470 50 310
0 0
Y
N
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
int t1[],t2[];
int main(){
int a,b;
while(scanf("%d%d",&a,&b)!=EOF){
if(a==&&b==)
break;
memset(t1,,sizeof(t1));
memset(t2,,sizeof(t2));
for(int i=;i<a;i++)
scanf("%d",&t1[i]);
for(int i=;i<b;i++)
scanf("%d",&t2[i]);
sort(t1,t1+a);
sort(t2,t2+b);
if(t1[]<t2[])
printf("Y\n");
else
printf("N\n"); } return ;
}
HDU 1939 HE IS OFFSIDE的更多相关文章
- hdu 3415 Max Sum of Max-K-sub-sequence 单调队列。
Max Sum of Max-K-sub-sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K ...
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
- hdu 4859 海岸线 Bestcoder Round 1
http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...
- HDU 4569 Special equations(取模)
Special equations Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- HDU 4006The kth great number(K大数 +小顶堆)
The kth great number Time Limit:1000MS Memory Limit:65768KB 64bit IO Format:%I64d & %I64 ...
- HDU 1796How many integers can you find(容斥原理)
How many integers can you find Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d ...
随机推荐
- 如何安装Ruby(Windows)
Ruby解释器的安装 1.Windows平台 想尽快安装并运行Ruby,可遵循如下步骤: 1.启动Web浏览器,访问 http://www.ruby-lang.org/en/downloads/ 2. ...
- C# as运算符
一.C# as运算符 as运算符用于执行引用类型的显式类型转换.请阅读C#数据类型. as运算符可以用下面的格式表示: expression as type?expression:引用类型的表达式. ...
- caffe中protobuf问题
安装caffe时,protobuf在使用import caffe时,python版的会提示protobuf的问题,原因是因为protobuf的安装是用python-proto,而在安装anaconda ...
- Python 初始—(文件操作)
文件修改,我们可以不用讲一个文件全部都进行读取,然后放入内存,如果文件过大,容易造成内存的 内存溢出问题 因此我们可以便读取边进行修改操作 f=open("old.txt",&qu ...
- JS - 属性描述符各配置的默认值的注意事项
通过字面量或者obj.x = 1;创建的属性 与 通过Object.defineProperty创建的属性,他们的属性描述符的默认值是不同的,前者都为true,后者都为false.
- Windows API窗口绘图程序设计
任务目标 设计一个简单的Windows 窗口程序,在程序窗口内任意位置按下鼠标左键,可绘制范围在10-100之间随机大小的正方形.并且显示的正方形用红色填充. 效果图 小结 程序先是触发鼠标左键点击事 ...
- 【转载】VS2015 + EF6连接MYSQL5.6
引用文章:https://jingyan.baidu.com/article/ce09321b9cc43f2bff858fbf.html 安装包注意点说明: 1.程序名称:mysql-for-visu ...
- Mysql 索引 简介
Mysql索引 索引的分类 索引的创建 索引的注意事项 什么是索引 索引是存储引擎用于快速查找记录的一种数据结构. 索引由数据库中一列或者多列组成,作用是提高表的查询速度. 索引的优点,提高检索数据的 ...
- 笔记-pytho-语法-yield
笔记-python-语法-yield 1. yield 1.1. yield基本使用 def fab(max): n,a,b = 0, 0, 1 while n < max: y ...
- contest0 from codechef
A CodeChef - KSPHERES 中文题意 Mandarin Chinese Eugene has a sequence of upper hemispheres and another ...