Difficult work | ||||||
|
||||||
Description | ||||||
小D故意难为GiGi兔,给她一个很棘手的work。 先给出一个n*n的方形,每个格子内放入一个数字a(0<=a<=100)。然后算出以(x1, y1), (x2, y2)为对角线的矩形内所有数字的和。 |
||||||
Input | ||||||
输入包含多组测试数据。 第一行包含两个正整数n和m(1=<n<=500,1=<m<=20000)。 接下来m行,每行包含四个整数x1, y1, x2, y2。(1<= x1<=x2, y1<= y2 <=n)。 |
||||||
Output | ||||||
每行包括一个数字和。(保证在32位整数内) |
||||||
Sample Input | ||||||
3 3 1 2 3 4 5 6 7 8 9 1 1 2 2 1 1 3 3 2 1 3 3 |
||||||
Sample Output | ||||||
12 45 39
直接暴力会超时,需要事先处理出每行的和,然后相减,看到有人用树状数组做,跑了400多MS,也是费力不讨好
|
详细解决方案
Hust oj 1693 Difficult work(水题)
热度:74 发布时间:2023-12-22 04:32:19.0
相关解决方案
- 试用期个人工作效果分析 Work Analysis (个人填写),该如何处理
- svn版本有关问题svn:this client is too old to work with working copy.
- 请教,net文件在./work下可运行,一到/work/work2便出错。怎么设置,才不会导致如下有关问题?
- 在自定义窗口中显示报表预览,为何点一下报表,出现“no table is open in the current work area”呢,该怎么解决
- It's difficult to find a good job!解决方案
- Thoughts of my mind for work or life解决方案
- Thoughts of my mind for work or life,该怎么解决
- May we contact you at work? 英语什么意思,该怎么解决
- 【2010.11.08】SVN版本有关问题:This client is too old to work with working copy
- SVN:This client is too old to work with working copy解决方法
- SVN有关问题:This client is too old to work with working copy
- 请教这代码里file:///D|/work/vod/Mbar.avi 什么意思
- Table innerHTML - work around
- 警告: Weblogic's StAX implementation is unsupported and some Axiom features will not work as expected
- How Tomcat Work――容易的Web应用程序
- today's work weblogic 9.2配备OK
- ie:download didn't work in the client side ,why,该怎么解决
- 地址http://localhost/work_0_123 实际可以连接到 work/0/123.shtml 这个是怎么实现的
- D:\tomcat\work\Catalina\localhost\_\org\apache\jsp\jaas_jsp.java:六: 需要 '.'
- 如何读/var/lib/tomcat/work/catalina/-/org/apache/jsp下的.java文件
- 试用期个人造作效果分析 Work Analysis (个人填写)
- the following projects must be upgraded to work correctly with MyEclipse 九
- MyEclipse work space in use or can not be created解决办法
- Eclipse插件调试Hadoop程序报/work/tmp does not exist
- eclipse中导入项目时add to work sets什么作用?该怎么解决
- Git错误:fatal: could not create work tree dir 'XXX' No such file or directory
- PROC编程次次都要EXEC SQL COMMIT WORK RELEASE这句过后才能真正入库
- PROC编程历次都要EXEC SQL COMMIT WORK RELEASE这句过后才能真正入库
- 还原msserver2005有关问题 'G:\ximin\C#work\数据库\HR.mdf' 上的媒体簇的结构不正确。SQL Server 无法处理此媒体簇
- android studio下提醒gradle project sync failed.Basic functionality will not work