当前位置:网站首页>Luogu_ P1003 [noip2011 improvement group] carpet laying_ Violence enumeration
Luogu_ P1003 [noip2011 improvement group] carpet laying_ Violence enumeration
2022-06-27 15:33:00 【This question AC sleep again】
Luogu _P1003 [NOIP2011 Improvement group ] Carpet _ Violence enumeration
//
#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 )
{ // Bottom point + Side length
return ( x>=z.a && x<=z.a+z.aa && y>=z.b && y<=z.b+z.bb );
} // The points on the rectangular carpet boundary and four vertices are also covered by the carpet
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-- ) // Traversal in reverse order
if( f( in[i] ) ) break;
if( i ) cout<<i<<endl;
else cout<<"-1"<<endl; // Special judgement
}
return 0;
}
// If you don't understand it, find out if there is any sample explanation
边栏推荐
- Massive data! Second level analysis! Flink+doris build a real-time data warehouse scheme
- 反射学习总结
- Cesium 使用MediaStreamRecorder 或者MediaRecorder录屏并下载视频,以及开启摄像头录像。【转】
- Today, Teng Xu came out with 37k during the interview. It's really a miracle. He showed me his skill
- #27ES6的数值扩展
- 关于 Spartacus 的 sitemap.xml 问题
- 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
- AbortController的使用
- 关于 SAP UI5 参数 $$updateGroupId 前面两个 $ 符号的含义
- 洛谷入门1【顺序结构】题单题解
猜你喜欢
ThreadLocal之强、弱、軟、虛引用
Keep valid digits; Keep n digits after the decimal point;
洛谷_P1007 独木桥_思维
Beginner level Luogu 2 [branch structure] problem list solution
Talk about redis transactions
[high concurrency] deeply analyze the callable interface
Strong, weak, soft and virtual references of ThreadLocal
Knowledge map model
R language error
volatile与JMM
随机推荐
#28对象方法扩展
Pychart installation and setup
R language triple becomes matrix matrix becomes triple
Beginner level Luogu 2 [branch structure] problem list solution
Leetcode 724. Find the central subscript of the array (yes, once)
FPGA based analog I ² C protocol system design (with main code)
How QT sets some areas to be transparent in the background image
Cannot determine value type from string ‘<p>1</p>‘
Hyperledger Fabric 2. X custom smart contract
Typescript learning materials
Knowledge map model
R language error
Teach you how to package and release the mofish Library
Reflection learning summary
关于快速幂
[interview questions] common interview questions (I)
Why can't the start method be called repeatedly? But the run method can?
LVI: feature extraction and sorting of lidar subsystem
Référence forte, faible, douce et virtuelle de threadlocal
CNN convolutional neural network (the easiest to understand version in History)