当前位置:网站首页>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
边栏推荐
- [digital signal processing] discrete time signal (analog signal, discrete time signal, digital signal | sampling leads to time discrete | quantization leads to amplitude discrete)
- LVI: feature extraction and sorting of lidar subsystem
- sql注入原理
- CAS comparison and exchange
- Problems encountered in vs compilation
- AI begets the moon, and thousands of miles share the literary heart
- 关于快速幂
- Knowledge map model
- Redis CacheClient
- 漏洞复现----34、yapi 远程命令执行漏洞
猜你喜欢

Hyperledger Fabric 2. X custom smart contract

反射学习总结

Today, Teng Xu came out with 37k during the interview. It's really a miracle. He showed me his skill

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

PSS:你距離NMS-free+提點只有兩個卷積層 | 2021論文

Keep valid digits; Keep n digits after the decimal point;

Talk about redis transactions

HTTP Caching Protocol practice

How QT sets some areas to be transparent in the background image

Strong, weak, soft and virtual references of ThreadLocal
随机推荐
注解学习总结
E-week finance Q1 mobile banking has 650million active users; Layout of financial subsidiaries in emerging fields
Design of UART controller based on FPGA (with code)
volatile与JMM
Talk about redis transactions
#27ES6的数值扩展
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
Notes learning summary
Reflection learning summary
Beginner level Luogu 2 [branch structure] problem list solution
June 27, 2022 Daily: swin transformer, Vit authors and others said: a good basic model is the simple pursuit of CV researchers
Beginner level Luogu 1 [sequence structure] problem list solution
What is the London Silver code
On traversal of tree nodes
élégant pool de threadpoolexecutor personnalisé
[digital signal processing] discrete time signal (analog signal, discrete time signal, digital signal | sampling leads to time discrete | quantization leads to amplitude discrete)
[advanced mathematics] from normal vector to surface integral of the second kind
关于快速幂
R language error
避孕套巨头过去两年销量下降40% ,下降原因是什么?