点击打开链接
Simplest Task in Windows


Time Limit: 2 Seconds      Memory Limit: 65536 KB


A typical windows platform may have several windows on the desktop. A user's operation may be as simple as a single click of the mouse. In the implementation of such a windows platform, one of the simplest tasks would be deciding which window had been clicked.

Given a serial of windows, for each mouse click, decide which window had been clicked. Please notice that windows may overlap, and the window on top would receive the click rather than others. And, we consider a window to be clicked even if the mouse is just on its edge/corner. For the sake of simplicity, we assume that a window will not be activated to the top by any click.

Input

The first part of input is a serial of windows. First an integer N (1 <= N <= 10) is given, indicating the number of windows. Then N lines follow, each containing four integers, x1, y1, x2, y2, (x1 < x2, y1 < y2) the coordinates of the upper-left and lower-right corners of a window. The windows are given in back-to-front order. N=0 signals the end of input.

The second part of input is a serial of mouse clicks. First an integer M (1 <= M <= 50) is given, indicating the number of mouse clicks. Then M lines follow, each containing two integers, x and y, the coordinates of a mouse click.

Output

For each mouse click in the input, output a single line containing the index (starting from 0) of the window which receives the click. If there is no such window, output "-1" in a line instead.

Sample Input

1
0 0 5 5
3
4 1
5 1
6 1
0

Sample Output

0
0
-1


Author: SHI, Xiaohan
Source: Zhejiang Provincial Programming Contest 2005
题意是说有电脑屏幕上有n个窗口,编号分别为0到n-1,给你每个窗口的左上角坐标和右下角坐标,可能有的窗口会覆盖,窗口时从后往前给的,然后给你m个坐标,让你判读这个坐标点击在第几个窗口上,如果覆盖则输出最前面的窗口编号,如果没有点击在窗口上,则输出-1.
#include<stdio.h>
#include<string.h>
int dp[107][107];
int main()
{int n;while(scanf("%d",&n),n){int a,b,c,d,m;memset(dp,-1,sizeof(dp));for(int i=0;i<n;i++){scanf("%d%d%d%d",&a,&b,&c,&d);for(int j=a;j<=c;j++)for(int k=b;k<=d;k++)dp[j][k]=i;}scanf("%d",&m);while(m--){scanf("%d%d",&a,&b);printf("%d\n",dp[a][b]);}}return 0;
}

ZOJ 2480 Simplest Task in Windows相关推荐

  1. spark中读取json_【spark】文件读写和JSON数据解析

    1.读文件 通过 sc.textFile("file://")方法来读取文件到rdd中. val lines = sc.textFile("file://")/ ...

  2. Windows Virtual PC RC 发布

    在 Windows 7 RTM 即将发布之际,Windows Virtual PC 迎来了 RC.Windows Virtual PC(WPC)更加成熟,从特性列表中,可以了解到 WPC 颗粒化的共享 ...

  3. 关闭Windows不必要服务,电脑更安全

    Windows集成了许多功能和服务,所以在很多领域得以应用:但是有很多服务是我们个人用户所用不到的,开启只会浪费内存和资源,并且成为黑客和病毒攻击的靶子,而且,还影响启动速度和运行速度.关掉大部分没用 ...

  4. php 计划任务 curl,通过Task Scheduler定时运行调用cURL的PHP脚本 | 学步园

    PHP本身没有定时自动执行的功能,也不支持多线程.但是结合Task Scheduler和cURL,就可以弥补PHP的上述两个缺陷,同时还可以脱离Apache服务器环境,在任意路径下运行PHP脚本. 知 ...

  5. 正在创建系统还原点_如何使Windows在启动时自动创建系统还原点

    正在创建系统还原点 By default, System Restore automatically creates a restore point once per week and also be ...

  6. 关闭windows垃圾服务

    Windows集成了许多功能和服务,所以在很多领域得以应用:但是有很多服务是我们个人用户所用不到的,开启只会浪费内存和资源,并且成为***和病毒***的靶子,而且,还影响启动速度和运行速度.关掉大部分 ...

  7. 分享Silverlight/WPF/Windows Phone一周学习导读(11月14日-11月20日)

    分享Silverlight/WPF/Windows Phone一周学习导读(11月14日-11月20日) 本周Silverlight学习资源更新 Silverlight App.xaml用途 Jaso ...

  8. 分享Silverlight/WPF/Windows Phone/HTML5一周学习导读(2月27日-3月4日)

    分享Silverlight/WPF/Windows Phone/HTML5一周学习导读(2月27日-3月4日) 本周Silverlight学习资源更新 Silverlight实用窍门系列:57.Sil ...

  9. Windows 2000 单词表

    A A (address) resource record / A(地址)资源记录 AAL, ATM adaptation layer / ATM 适配层 ABR, area border route ...

  10. 关于windows桌面网络图标显示未连接却可以上网的情况

    RT, 题主某次更新注册表之后出现网络图标无法正常显示的情况,具体情况如下: 1.网络与共享中心中的网络信息显示为未知. 2.开机后需等待网络图标从正在连接转变为未连接,否则再次关机时会出现" ...

最新文章

  1. C/C++之变长数组(VLA)和可伸缩型数组成员
  2. luogu_P3313 [SDOI2014]旅行
  3. python列表去掉特定项_python实现删除列表中某个元素的3种方法
  4. 产品经理适合当项目经理吗?
  5. 胶东机场t1离哪个停车场近,青岛胶东国际机场停车场攻略
  6. RoboCode 参考代码
  7. 第五章---面向对象---小练习
  8. 华三路由器虚拟服务器设置,H3C vLNS系列虚拟L2TP网络服务器 配置指导-E0324-5W100...
  9. 【LaTeX应用】文字方向,文字竖排
  10. 计算方法复习提纲-中
  11. 固定资产管理系统 概要说明书说明书
  12. Java程序员考研失败后的面试经历,oppo、VIVO、等面经
  13. 执行git reset --hard后文件的恢复
  14. 4年老用户!从R9s Plus换到Find X3,这些体验太上头
  15. 国产手机扬眉吐气,终于打击了苹果的嚣张气焰
  16. 如何理解光圈、ISO、快门、曝光这几个概念?
  17. 论文阅读-WARP: Word-level Adversarial ReProgramming
  18. ai智能时代 设计师的出路_适用于网页设计师的人工智能工具
  19. 74HC1G66模拟开关,多路复用
  20. 小米木丨整体木作:巧用藤编,让家居定制更出彩!-安徽梵衍木业有限公司

热门文章

  1. mac电脑如何找到usr文件夹
  2. Android中仿微信选择图片并展示在RecyclerView中
  3. MXNet使用---复现、训练、测试人脸角度检测FSA-Net(SSR-MT)模型为例
  4. Dingoapi的使用
  5. #91;#12304;#26469;#20998;#26399;#23458;#26381;#30005;#35805;#12305;#93;
  6. 计算机所有以太网适配的ip,Win10电脑以太网没有有效的ip配置怎么解决?附上具体解决方法...
  7. 自然语言处理-003NLP定义以及歧义性-学习笔记
  8. 亚控科技的KingSCADA多个漏洞
  9. stm32头文件学习之Core_cm3.c(h)
  10. 2020-11-16 MHF-NET乱读集锦