Java界面程序实现图片的放大缩小。这个程序简单地实现了图片的打开、保存、放大一倍、缩小一倍和固定缩放尺寸,但是并没有过多的涵盖对图片的细节处理,只是简单地实现了图片大小的放缩。 思维导图如下: 效果图如下: 代码如下: package picture; import java.awt.*; imp ...
分类:
编程语言 时间:
2018-03-10 12:06:35
阅读次数:
338
题目:Luogu 1856 扫描线,将矩形拆成两条边分别为 +1 和 -1,计算无重叠部分的长度。 由于 update 区间 [a, b] 和 [b, c] 时会把 b 加两次,所以统一转换成 [a,b),累加长度的时候再将右端点右移。 需要注意,在覆盖一条边时,不能直接累加边的长度,像下图: 在覆 ...
分类:
其他好文 时间:
2018-03-06 23:26:20
阅读次数:
310
看到一坨矩形就要想到扫描线。(poj atantis) 我们把横边竖边分开计算,因为横边竖边其实没有区别,以下论述全为考虑竖边的。 怎样统计一个竖边对答案的贡献呢?答:把这个竖边加入线段树,当前的总覆盖长度 减去 加入前的总覆盖长度 的绝对值 即为这个竖边的贡献。 这样做有一个要求,横坐标相同的竖边 ...
分类:
其他好文 时间:
2018-03-03 22:27:32
阅读次数:
184
Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are ...
分类:
其他好文 时间:
2018-03-02 12:32:17
阅读次数:
202
题目链接:http://poj.org/problem?id=1128 题目: Description Consider the following 5 picture frames placed on an 9 x 8 array. ........ ........ ........ ..... ...
分类:
编程语言 时间:
2018-02-21 10:47:37
阅读次数:
213
Robot Bender decided to make Fray a birthday present. He drove n nails and numbered them from 1 to n in some order. Bender decided to make a picture u ...
分类:
其他好文 时间:
2018-02-13 20:11:27
阅读次数:
189
Before setting CPU affinities for device interrupts and application processes and threads it is important to get an accurate picture of CPU physical l ...
分类:
其他好文 时间:
2018-02-12 13:40:09
阅读次数:
171
file:文件 video视频文件、Audio音频文件、picture图片文件 、directory目录文件(exe、txt、) patch:补丁 driver:驱动 home :主页/主目录 window:窗口 desktop:桌面 browser:浏览器 server:服务器 client:客户 ...
分类:
其他好文 时间:
2018-02-10 18:19:48
阅读次数:
184
Problem Description The picture indicates a tree, every node has 2 children. The depth of the nodes whose color is blue is 3; the depth of the node wh ...
分类:
其他好文 时间:
2018-02-04 22:37:49
阅读次数:
171
https://www.luogu.org/problemnew/show/P1856 1.每个矩形由两条横向边和两条纵向边组成. 2.对于横向边,按纵坐标排序。设当前讨论的边为 A [s , t] 如果 A 是某个矩形的靠下的边,在树中查询[s,t]区间中被覆盖的长度为x,那么加上这条边后将增加( ...
分类:
其他好文 时间:
2018-02-02 22:05:48
阅读次数:
243