为何最后三个点没过

评测结果

编译成功

测试数据 #0: Accepted, time = 0 ms, mem = 488 KiB, score = 10

测试数据 #1: Accepted, time = 0 ms, mem = 492 KiB, score = 10

测试数据 #2: Accepted, time = 0 ms, mem = 492 KiB, score = 10

测试数据 #3: Accepted, time = 0 ms, mem = 488 KiB, score = 10

测试数据 #4: Accepted, time = 15 ms, mem = 496 KiB, score = 10

测试数据 #5: Accepted, time = 0 ms, mem = 488 KiB, score = 10

测试数据 #6: RuntimeError, time = 31 ms, mem = 496 KiB, score = 0

测试数据 #7: RuntimeError, time = 15 ms, mem = 488 KiB, score = 0

测试数据 #8: RuntimeError, time = 15 ms, mem = 484 KiB, score = 0

测试数据 #9: RuntimeError, time = 15 ms, mem = 484 KiB, score = 0

RuntimeError, time = 91 ms, mem = 496 KiB, score = 60

代码

#include <cstdio>
#include <iostream>
using namespace std;
int a[1005],b[1005],c[1005],d[1005];

int n,x,y,s=-1;
int main (){
int i;
scanf("%d",&n);
for (i=1;i<=n;i++){
scanf("%d%d%d%d",&a[i],&b[i],&c[i],&d[i]);
c[i]+=a[i];
d[i]+=b[i];
}
scanf("%d%d",&x,&y);

for (i=1;i<=n;i++)
if (x>=a[i] && x<=c[i] && y>=b[i] && y<=d[i])
s=i;
printf ("%d\n",s);
return 0;

}
求解啊!

4 条评论

  • 1

信息

ID
1736
难度
4
分类
搜索 | 枚举 点击显示
标签
递交数
4972
已通过
2207
通过率
44%
被复制
14
上传者