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 ...
随机推荐
- Redis 命令学习
每天不学习点新的东西,感觉就有点会被社会淘汰掉了.也许现在学习的知识会很快忘记,下次学习用到这个知识点的时候,再回来翻记录的笔记,我想这样会比从头再学,效率会高点吧. 闲话不多聊,回归正题.今天学习r ...
- OpenMP常用函数
1.设置线程数目 定义如下: void omp_set_num_threads(int num_threads); 通过该函数来指定其后用于并行计算的线程数目,其中参数num_threads就是指定的 ...
- js世界这么大,闭包想看看
什么是闭包,为什么要用他?闭包是能够访问其他函数作用域的函数.我们来分析下句子成分(语文大神),闭包是函数,js函数的作用域分为全局作用域,局部作用域,eval作用域,并没有块级作用域形象的讲,每个函 ...
- git和svn的混用
服务器上的项目是使用svn进行管理的. 本来本地的项目也是通过svn进行管理的,但是后来使用svn的分支功能进行项目的测试/新功能等等时,总是会出现各种各样的问题,遂转投git. 因为git的分支机制 ...
- tomcat8080端口占用解决办法
打开控制台,在窗口中输入指令:netstat -ano | findstr 8080 指令的意思是找出占用8080端口的进程pid 上图中表示占用进程pid为23288,然后再次输入指令: ...
- IDEA的使用方法(一)(IDEA基本快捷键)
一个软件的快捷键显得尤为重要,接下来来讲讲快捷键 CTR+N 搜索类 CTR+SHIT+N 搜索文件 CTR+ALT+空格 代码提示(类似于 ALT+/) ALT+F7 查询在某处使用 CTR+Q 查 ...
- 读键值对封装成Map
描述: 有配置文件address_relation.properties,记录地址关系,有如下数据:ZSSS=ZS%,ZSPD, 封装到Map代码如下: public static void main ...
- chorme浏览器不支持audio/video中的autoplay属性的解决方法
在chrome 浏览器中输入:chrome://flags 再搜索audio,找到Autoplay policy 再在右侧的选项中设置为 no user gesture is required 即可
- 【jQuery】手机验证码倒计时效果
<ul class="ulist"> <li class="group"> <label class="label&qu ...
- C语言字符篇(四)字符串查找函数
#include <string.h> char *strchr(const char *s, int c); The strchr() function returns a ...