希望更丰富的展现?[使用Markdown](https://www.luogu.org/wiki/show?name=%E5%B8%AE%E5%8A%A9%EF%BC%9Amarkdown)
by Drinkkk @ 2018-08-18 16:05:45
@[单润琦](/space/show?uid=53338)
by Drinkkk @ 2018-08-18 16:05:49
推荐你```
and
``` 写成```
&&
``` 吧,因为C++里用and的不多
by 哔哩哔哩 @ 2018-08-18 16:06:40
and 写成 &&
by 哔哩哔哩 @ 2018-08-18 16:06:51
@[哔哩哔哩](/space/show?uid=41868) 嗯,那个,实际上and==&&,而且改完也没用啊,?
by 单润琦 @ 2018-08-18 16:22:18
可以下载数据吗 能的话下载数据 测试一下
by 哔哩哔哩 @ 2018-08-18 16:24:57
尝试一下longlong?
by baby_lu0 @ 2018-08-27 17:18:57
建议把数组改成栈(虽然都一样,但不容易写错)
我的AC代码:(不要抄,自己体会)
```
#include <bits/stdc++.h>
using namespace std;
struct di{
int x,y;
int l,w,i;
di(int x,int y,int l,int w,int i):x(x),y(y),l(l),w(w),i(i){}
};
stack<di> s;
int a,b,c,d,n,xx,yy;
int main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>a>>b>>c>>d;
di j(a,b,c,d,i+1);
s.push(j);
}
cin>>xx>>yy;
while(true){
if(xx>=s.top().x &&
xx<=s.top().x + s.top().l &&
yy>=s.top().y &&
yy<=s.top().y + s.top().w
){
cout<<s.top().i;
return 0;
}
s.pop();
}
cout<<"-1";
return 0;
}
```
by 御坂13558号 @ 2018-11-28 20:58:48
建议把编号写在结构体里,否则容易错
by 御坂13558号 @ 2018-11-28 21:03:10