当前位置:网站首页>洛谷_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;
}
// 没看懂就先找一找有没有样例解释
边栏推荐
- 522. longest special sequence II / Sword finger offer II 101 Split equal sum subset
- CAS之比较并交换
- Vscode uses yapf auto format to set the maximum number of characters per line
- 阅读别人的代码,是一种怎样的体验
- Elegant custom ThreadPoolExecutor thread pool
- volatile与JMM
- Professor huangxutao, a great master in CV field, was born at the age of 86. UIUC specially set up a doctoral scholarship to encourage cutting-edge students
- How is the London Silver point difference calculated
- June 27, 2022 Daily: swin transformer, Vit authors and others said: a good basic model is the simple pursuit of CV researchers
- [advanced mathematics] from normal vector to surface integral of the second kind
猜你喜欢

海量数据!秒级分析!Flink+Doris构建实时数仓方案

What kind of experience is it to read other people's code

QT 如何在背景图中将部分区域设置为透明

Teach you how to realize pynq-z2 bar code recognition
![[xman2018 qualifying] pass](/img/eb/7bf04941a96e9522e2b93859266cf2.png)
[xman2018 qualifying] pass

How is the London Silver point difference calculated

Lei Jun lost another great general, and liweixing, the founding employee of Xiaomi No. 12, left his post. He once had porridge to create Xiaomi; Intel's $5.4 billion acquisition of tower semiconductor

Unity3d best practices: folder structure and source control

Interpretation of new version features of PostgreSQL 15 (including live Q & A and PPT data summary)

CAS comparison and exchange
随机推荐
[digital signal processing] discrete time signal (analog signal, discrete time signal, digital signal | sampling leads to time discrete | quantization leads to amplitude discrete)
Go error collection | when a function uses a return value with a parameter name
E-week finance Q1 mobile banking has 650million active users; Layout of financial subsidiaries in emerging fields
Talk about redis transactions
Principle Comparison and analysis of mechanical hard disk and SSD solid state disk
Creation and use of static library (win10+vs2022
原子操作类
数学建模经验分享:国赛美赛对比/选题参考/常用技巧
Is flutter easy to learn? How to learn? The most complete introduction and actual combat of flutter in history. Take it away without thanks~
CAS comparison and exchange
[WUSTCTF2020]girlfriend
Je veux acheter des produits à revenu fixe + mais je ne sais pas quels sont ses principaux investissements.
请求一下子太多了,数据库危
16 -- 删除无效的括号
PR second training notes
反射学习总结
老师能给我说一下固收+产品主要投资于哪些方面?
The global chip market may stagnate, and China's chip expansion accelerates to improve its self-sufficiency rate against the trend
Privacy computing fat offline prediction
隱私計算FATE-離線預測