当前位置:网站首页>洛谷_P1003 [NOIP2011 提高组] 铺地毯_暴力枚举
洛谷_P1003 [NOIP2011 提高组] 铺地毯_暴力枚举
2022-06-27 15:23:00 【这题AC再睡.】
洛谷_P1003 [NOIP2011 提高组] 铺地毯_暴力枚举

//
#include<bits/stdc++.h>
using namespace std;
const int N=11111;
struct rug{ int a,b,aa,bb; }in[N];
int x,y;
bool f( const struct rug &z )
{ // 底点+边长
return ( x>=z.a && x<=z.a+z.aa && y>=z.b && y<=z.b+z.bb );
} // 在矩形地毯边界和四个顶点上的点也算被地毯覆盖
int main()
{
int n,i;
while( cin>>n )
{
memset( in,0,sizeof( in ) );
for( i=1;i<=n;i++ )
{
cin>>in[i].a>>in[i].b>>in[i].aa>>in[i].bb;
}
cin>>x>>y;
for( i=n;i;i-- ) // 逆序遍历
if( f( in[i] ) ) break;
if( i ) cout<<i<<endl;
else cout<<"-1"<<endl; // 特判
}
return 0;
}
// 没看懂就先找一找有没有样例解释
边栏推荐
- Experience sharing of mathematical modeling: comparison between China and USA / reference for topic selection / common skills
- 阅读别人的代码,是一种怎样的体验
- AutoCAD - line width setting
- What are the operating modes of the live app? What mode should we choose?
- 反射学习总结
- Acwing game 57
- [high concurrency] deeply analyze the callable interface
- Use GCC to generate an abstract syntax tree "ast" and dump it to Dot file and visualization
- Using redis skillfully to realize the like function, isn't it more fragrant than MySQL?
- 基于WEB平台的阅读APP设计与实现
猜你喜欢

Interview question: rendering 100000 data solutions

Computer screen splitting method

What is the London Silver unit

原子操作类

隱私計算FATE-離線預測

直播app运营模式有哪几种,我们该选择什么样的模式?

【微服务|Sentinel】热点规则|授权规则|集群流控|机器列表
![[digital signal processing] discrete time signal (discrete time signal knowledge points | signal definition | signal classification | classification according to certainty | classification according t](/img/69/daff175c3c6a8971d631f9e681b114.jpg)
[digital signal processing] discrete time signal (discrete time signal knowledge points | signal definition | signal classification | classification according to certainty | classification according t

Too many requests at once, and the database is in danger

Programming skills: script scheduling
随机推荐
Using redis skillfully to realize the like function, isn't it more fragrant than MySQL?
AQS抽象队列同步器
Maximum profit of stock (offer 63)
关于 SAP UI5 参数 $$updateGroupId 前面两个 $ 符号的含义
Jupiter core error
Abnormal analysis of pcf8591 voltage measurement data
关于 Spartacus 的 sitemap.xml 问题
16 -- 删除无效的括号
Julia1.1 installation instructions
Library management system
Tsinghua & Shangtang & Shanghai AI & CUHK proposed Siamese image modeling, which has both linear probing and intensive prediction performance
Privacy computing fat offline prediction
HTTP Caching Protocol practice
AutoCAD - line width setting
R language objects are stored in JSON
Je veux acheter des produits à revenu fixe + mais je ne sais pas quels sont ses principaux investissements.
隐私计算FATE-离线预测
Reflection learning summary
Vscode uses yapf auto format to set the maximum number of characters per line
ThreadLocal之强、弱、软、虚引用