luoguP1003 铺地毯  题目

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
inline int read()
{
int sum=,p=;char ch=getchar();
while(!((''<=ch && ch<='') || ch=='-'))ch=getchar();
if(ch=='-')p=-,ch=getchar();
while(''<=ch && ch<='')sum=sum*+ch-,ch=getchar();
return sum*p;
}
struct ditan{
int zxx,zxy,ysx,ysy;
}a[];
int main()
{
int n,xx,yy,lx,ly,x,y;
n=read();
for(int i=;i<=n;i++)
{
xx=read();yy=read();lx=read();ly=read();
a[i].zxx=xx;a[i].zxy=yy;a[i].ysx=xx+lx;a[i].ysy=yy+ly;
}
x=read();y=read();
for(int i=n;i>=;i--)
{
if(a[i].zxx<=x&&a[i].zxy<=y&&a[i].ysx>=x&&a[i].ysy>=y)
{
cout<<i<<endl;
return ;
}
}
cout<<"-1"<<endl;
return ;
}

最新文章

  1. PMP--综合考试知识点,持续更新中。。。
  2. Android的setVisibility(View.GONE)无效的问题及原因分析
  3. C++基础入门
  4. Notice: Trying to get property of non-object problem(PHP)解决办法 中间件只能跳转不能返任何数据
  5. 信息安全系统设计基础exp_4
  6. mapping 详解1(mapping type)
  7. dedecms修改templets为别的名字
  8. 关于android:screenOrientation=&quot;portrait&quot; 横竖屏切换
  9. C#操作Xml:XSLT语法 在.net中使用XSLT转换xml文档示例
  10. IOC and DI
  11. phpcms v9 后台首页 去掉团队信息等版权
  12. 警惕!MySQL成数据勒索新目标
  13. 一次关于mongodb性能踩坑的总结
  14. java子类和父类中静态块、非静态块、构造函数的执行顺序
  15. bootstrap-datepicker简单使用
  16. C 长字符串换行方法
  17. Python中通过lambda抛异常的奇技淫巧
  18. Mysql5.6 自动化部署
  19. Swoole 异步mysql使用
  20. MD Test

热门文章

  1. CSS3 Animations
  2. C#基础提升系列——C#任务和并行编程
  3. 030:spaceless和autoescape 标签
  4. 3,LinkedList
  5. delegate operator (C# reference) and =&gt; operator (C# reference)
  6. 使用WebAPI流式传输大文件(在IIS上大于2GB)
  7. Yii 1.1 常规框架部署和配置
  8. RDA项目debug
  9. win10下VMware15运行ubuntu18.04无法和主机之间复制粘贴问题
  10. python numpy求四分位距