上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 25 下一页

2014年3月1日

POJ -- 1151

摘要: AtlantisTime Limit:1000MSMemory Limit:10000KTotal Submissions:16222Accepted:6172DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe different reg 阅读全文

posted @ 2014-03-01 18:21 ~Love() 阅读(161) 评论(0) 推荐(0)

线段树求矩形面积并 扫描线+离散化

摘要: 顾名思义,扫描法就是用一根想象中的线扫过所有矩形,在写代码的过程中,这根线很重要。方向的话,可以左右扫,也可以上下扫。方法是一样的,这里我用的是由下向上的扫描法。如上图所示,坐标系内有两个矩形。位置分别由左下角和右上角顶点的坐标来给出。上下扫描法是对x轴建立线段树,矩形与y平行的两条边是没有用的,在这里直接去掉。如下图。现想象有一条线从最下面的边开始依次向上扫描。线段树用来维护当前覆盖在x轴上的线段的总长度,初始时总长度为0。用ret来保存矩形面积总和,初始时为0。由下往上扫描,扫描到矩形的底边时将它插入线段树,扫描到矩形的顶边时将底边从线段树中删除。而在代码中实现的方法就是,每条边都有一个f 阅读全文

posted @ 2014-03-01 10:02 ~Love() 阅读(1475) 评论(0) 推荐(3)

2014年2月27日

POJ -- 3468

摘要: A Simple Problem with IntegersTime Limit:5000MSMemory Limit:131072KTotal Submissions:53255Accepted:15926Case Time Limit:2000MSDescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interv 阅读全文

posted @ 2014-02-27 19:04 ~Love() 阅读(224) 评论(0) 推荐(0)

HDOJ--1698

摘要: Just a HookTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14516Accepted Submission(s): 7176Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecu 阅读全文

posted @ 2014-02-27 13:17 ~Love() 阅读(201) 评论(0) 推荐(0)

2014年2月25日

简单的API应用

摘要: 对于初学系统编程,了解下系统的API是必要的;下面这个程序实现的是将自身程序复制到windows目录和系统目录; 1 #include 2 #include 3 #include 4 void copyself() 5 { 6 char selfpath[MAX_PATH]{0}; 7 char windowspath[MAX_PATH]{0}; 8 char systempath[MAX_PATH]{0}; 9 char tmppath[MAX_PATH]{0};10 GetModuleFileName(NULL,selfpath,MAX_PATH);... 阅读全文

posted @ 2014-02-25 19:37 ~Love() 阅读(146) 评论(0) 推荐(0)

2014年1月10日

Linux引导流程

摘要: 最近学习了linux引导流程,简单总结下。我下面写的内容告诉了大家我们启动linux系统,从按下电源的那刻起计算机都做了什么,当然本文是针对linux系统而言的。第一步:固件firmware(CMOS/BIOS)POST (power on self test),加电自检过程,这是基于PC的就是说不依赖操作系统的,不管是linux还是windows这个步骤都是一样要进行下去的,就算我们有一台裸机也是一样,这个阶段firmware对硬件进行检测,检测硬件是否正常,比如线是否插好等等,这是在硬件层面就是物理层面上来检测的。之所以把CMOS/BIOS称之为固件是因为我们不能把它简单的称为软件,因为它 阅读全文

posted @ 2014-01-10 20:10 ~Love() 阅读(207) 评论(0) 推荐(0)

2014年1月7日

Python 实现网络爬虫小程序

摘要: Python很简洁,也很强大,作为兴趣,值得一学!下面这个程序实现的是从一个网站上下载图片,根据自己需要可以进行修改 1 import re 2 import urllib 3 4 def gethtml(url): 5 page = urllib.urlopen(url) 6 html = page.read() 7 return html 8 9 def getimg(html):10 reg = r'src="(.*?\.jpg)"'11 imgre = re.compile(reg)12 imglist = re.findall(im... 阅读全文

posted @ 2014-01-07 21:46 ~Love() 阅读(422) 评论(0) 推荐(0)

2013年12月30日

codeforce

摘要: A. Playing with Dicetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwo players are playing a game. First each of them writes an integer from 1 to 6, and then a dice is thrown. The player whose written number got closer to the number on the dice w 阅读全文

posted @ 2013-12-30 00:00 ~Love() 阅读(350) 评论(0) 推荐(0)

2013年12月29日

Count the string -- HDOJ 3336

摘要: Count the stringTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3637Accepted Submission(s): 1689Problem DescriptionIt is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write dow 阅读全文

posted @ 2013-12-29 23:23 ~Love() 阅读(226) 评论(0) 推荐(0)

2013年12月21日

初次运行 Git 前的配置

摘要: 初次运行 Git 前的配置一般在新的系统上,我们都需要先配置下自己的 Git 工作环境。配置工作只需一次,以后升级时还会沿用现在的配置。当然,如果需要,你随时可以用相同的命令修改已有的配置。Git 提供了一个叫做 git config 的工具(译注:实际是git-config命令,只不过可以通过git加一个名字来呼叫此命令。),专门用来配置或读取相应的工作环境变量。而正是由这些环境变量,决定了 Git 在各个环节的具体工作方式和行为。这些变量可以存放在以下三个不同的地方:/etc/gitconfig文件:系统中对所有用户都普遍适用的配置。若使用git config时用--system选项,读写 阅读全文

posted @ 2013-12-21 10:33 ~Love() 阅读(158) 评论(0) 推荐(0)

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 25 下一页

导航