当前位置:网站首页>洛谷_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;
}
// 没看懂就先找一找有没有样例解释
边栏推荐
- Great God developed the new H5 version of arXiv, saying goodbye to formula typography errors in one step, and the mobile phone can easily read literature
- E-week finance Q1 mobile banking has 650million active users; Layout of financial subsidiaries in emerging fields
- [high concurrency] deeply analyze the callable interface
- 2022-2-15 learning the imitated Niuke project - Section 5 shows comments
- Volatile and JMM
- SQL parsing practice of Pisa proxy
- Semaphore of thread synchronization
- Admixture usage document Cookbook
- Tsinghua & Shangtang & Shanghai AI & CUHK proposed Siamese image modeling, which has both linear probing and intensive prediction performance
- Hyperledger Fabric 2. X custom smart contract
猜你喜欢

Use GCC to generate an abstract syntax tree "ast" and dump it to Dot file and visualization

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

SQL parsing practice of Pisa proxy

Volatile and JMM

External memory

Creation and use of static library (win10+vs2022

Hyperledger Fabric 2. X custom smart contract

巧用redis实现点赞功能,它不比mysql香吗?

What is the London Silver code

Programming skills: script scheduling
随机推荐
Overseas warehouse knowledge popularization
易周金融 | Q1手机银行活跃用户规模6.5亿;理财子公司布局新兴领域
How to change a matrix into a triple in R language (i.e. three columns: row, col, value)
Unity3d best practices: folder structure and source control
Je veux acheter des produits à revenu fixe + mais je ne sais pas quels sont ses principaux investissements.
How to select cross-border e-commerce multi merchant system
Web chat room system based on SSM
Volatile and JMM
Getting to know cloud native security for the first time: the best guarantee in the cloud Era
原子操作类
基于SSM的Web网页聊天室系统
my. INI file configuration
In the past, domestic mobile phones were arrogant in pricing and threatened that consumers would like to buy or not, but now they have plummeted by 2000 for sale
Synchronized and lock escalation
Redis persistence
Resolve activity startup - lifecycle Perspective
PCL Library - error reporting solution: cmake and Anaconda conflicts during installation
522. longest special sequence II / Sword finger offer II 101 Split equal sum subset
Maximum profit of stock (offer 63)
SQL parsing practice of Pisa proxy