Pick公式:平面上以格子点为顶点的简单多边形的面积=边上的点数/2+内部的点数+1。代码如下:------------------------------------------------------------------------------------------------------...
分类:
其他好文 时间:
2015-10-27 17:06:33
阅读次数:
189
题目大意:以原点为起点然后每次增加一个x,y的值,求出来最后在多边形边上的点有多少个,内部的点有多少个,多边形的面积是多少。分析:1、以格子点为顶点的线段,覆盖的点的个数为GCD(dx,dy),其中,dxdy分别为线段横向占的点数和纵向占的点数。如果dx或dy为0,则覆盖的点数为dy或dx。2、Pi...
分类:
其他好文 时间:
2015-10-27 16:53:33
阅读次数:
168
题目传送门题意:就是小时候玩的一种游戏,问有多少线段盖在最上面分析:简单线段相交,队列维护当前最上的线段/************************************************* Author :Running_Time* Created Time :201...
分类:
其他好文 时间:
2015-10-26 18:43:54
阅读次数:
149
sudo nano /etc/ntp.conf然后找到# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will# pick a different set every time it starts up. ...
分类:
Web程序 时间:
2015-10-24 14:23:43
阅读次数:
2735
D - Pick The SticksTime Limit: 1 Sec Memory Limit: 256 MB题目连接无DescriptionThe story happened long long ago. One day, Cao Cao made a special order calle...
分类:
其他好文 时间:
2015-10-22 00:16:03
阅读次数:
183
题目:DescriptionLet's consider m apples divided into n groups. Each group contains no more than 100 apples, arranged in a line. You can take any number ...
分类:
其他好文 时间:
2015-10-18 22:59:10
阅读次数:
201
MarketTime Limit:2 Seconds Memory Limit:65536 KBThere's a fruit market in Byteland. The salesmen there only sell apples.There arensalesmen in the frui...
分类:
其他好文 时间:
2015-10-16 20:46:43
阅读次数:
301
In this blog, we give a solution for Quick Select.Here, we have an improvement.The idea is to randomly pick a pivot element.Main difference is how we ...
分类:
其他好文 时间:
2015-10-10 01:37:14
阅读次数:
234
git reset --hard HEAD|commit HEAD清掉现在的head HEAD~2 清掉最后两次提交 | commit 跳转到指定的一次commitgitreflog 找回reset的撤销git revert commit 回滚到commitgit cherry-pick用于把...
分类:
其他好文 时间:
2015-10-09 12:15:00
阅读次数:
132
下面的解决方案适用于,多个零件同时围绕一个点旋转,而不是围绕各自的一点 旋转.1. Edit->Move,在 Options 中 Rotation 的 Point 选 User PICk,2 再右键选 Term Group,按住鼠标左键不放并拉一个框选中器件,多余的可用 CTRl+鼠标左键点击去掉....
分类:
其他好文 时间:
2015-10-05 16:46:13
阅读次数:
224