程序控

IPPP (Institute of Penniless Peasent-Programmer) Fellow

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

摘要: 本博客致力于基础算法的学习与研究,文章每字每句都经过仔细斟酌。如果您对算法或C++/STL感兴趣,相信随便看看也会有所收获!OJ ProblemsOJ解题志关于OJ系列文章的说明转载:UVa OJ全部题目列表(按难度分级,仅标题)ZOJ 1002 - Fire NetUVa OJ 100 - The 3n + 1 problem (3n + 1问题)UVa OJ 101 - The Blocks Problem (积木问题)UVa OJ 102 - Ecological Bin Packing (生态学装箱问题)UVa OJ 103 - Stacking Boxes (嵌套盒子)UVa OJ 阅读全文
posted @ 2010-08-09 17:32 Devymex 阅读(23315) 评论(0) 推荐(1) 编辑

2015年1月13日

摘要: 1. 打开注册表,找到下面的键HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\0012ee47-9041-4b5d-9b77-535fba8b1442\6738e2c4-e8a5-4a42-b16a-e0... 阅读全文
posted @ 2015-01-13 21:59 Devymex 阅读(6370) 评论(0) 推荐(1) 编辑

2014年12月16日

摘要: 一、安装相关软件在Windows中安装VirtualBox;在VirtualBox中安装Ubuntu Server;在Ubuntu Server中安装cifs-utils:sudo apt-get install cifs-utils;在Ubuntu Server中安装Octave:sudo apt... 阅读全文
posted @ 2014-12-16 16:16 Devymex 阅读(4516) 评论(3) 推荐(1) 编辑

2014年12月10日

摘要: 已移动至:http://www.zhihu.com/question/21961711/answer/34891413★★★★★FBI WARNING★★★★★以下操作相当于给内网的防火墙上开了个洞,会给整个内网带来极其严重的安全隐患!为避免产生法律问题,请在操作前务必向网络管理员咨询您的操作权限!... 阅读全文
posted @ 2014-12-10 21:44 Devymex 阅读(101879) 评论(5) 推荐(4) 编辑

2014年8月10日

摘要: 入手小红点蓝牙键盘(ThinkPad Compact Bluetooth),手感极佳,小红点特别适合程序员工作,双手无需离开键盘就可以操作鼠标,完全解决肩部、腕部疲劳酸痛问题,程序员健康的大福音!使用前一定要安装官方驱动:http://support.lenovo.com/us/en/documen... 阅读全文
posted @ 2014-08-10 14:15 Devymex 阅读(21807) 评论(2) 推荐(0) 编辑

2014年5月4日

摘要: 修电脑军规20条,时刻谨记在心:1. 首先记住这句话:永远不要承认自己是高手,因为这个称号是要付出代价的。2. 接到陌生电话后,一定要问清楚对方有什么事情,然后再告诉他(她)当前你目前所在的位置。3. 永远不要试图通过电话或者QQ解决某个问题,对方很有可能不知道菜单是什么东西,这不能怨他们,只能怨你... 阅读全文
posted @ 2014-05-04 21:43 Devymex 阅读(4386) 评论(2) 推荐(2) 编辑

2014年2月17日

摘要: 贝多芬第九交响曲,卡拉扬63年版。此唱片第四乐章分两部分,这是第2部分,即演唱部分的歌词lrc文件。手工对时间轴,翻译。http://files.cnblogs.com/devymex/B_op125_K63.7z 阅读全文
posted @ 2014-02-17 10:04 Devymex 阅读(8412) 评论(1) 推荐(0) 编辑

2013年10月28日

摘要: 快十年了,此系列文章给博客园带来了非常多的流量,现在竟然告诉我不适合在主页展示,第一篇直接给我 404。 我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。 已 阅读全文
posted @ 2013-10-28 17:05 Devymex 阅读(71612) 评论(24) 推荐(15) 编辑

2013年10月27日

摘要: 快十年了,此系列文章给博客园带来了非常多的流量,现在竟然告诉我不适合在主页展示,第一篇直接给我 404。 我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。 已 阅读全文
posted @ 2013-10-27 18:53 Devymex 阅读(83021) 评论(14) 推荐(11) 编辑

2013年10月26日

摘要: 快十年了,此系列文章给博客园带来了非常多的流量,现在竟然告诉我不适合在主页展示,第一篇直接给我 404。 我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。 已 阅读全文
posted @ 2013-10-26 16:30 Devymex 阅读(113653) 评论(37) 推荐(25) 编辑

2013年10月25日

摘要: 快十年了,此系列文章给博客园带来了非常多的流量,现在竟然告诉我不适合在主页展示,第一篇直接给我 404。 我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。我谢谢你。 已 阅读全文
posted @ 2013-10-25 16:45 Devymex 阅读(179278) 评论(29) 推荐(12) 编辑

2013年9月22日

摘要: 这套方法是基于“层先法”的框架,所记忆的公式最少(5个)、最短(平均7步)、操作单一(集中于两三个面上的操作),因此特别适合初学者练手。第一步:底层十字任选一个面为D面,以中心块颜色为准,转成同色十字,要注意底层的四个边块的侧面要与所在侧面的中心块颜色一致。第二步:底层归位将底层的4个角块转好,同样要注意角块的两个侧面要与所在侧面的中心块颜色一致。第三步:中层归位任选一个面为F面,公式V:U-L-U-L+U+F+U+F-,可将U棱中块归位到L棱中块位置上,且F面不会翻转。第四步:顶层十字公式W:R-U-F-U+F+R+,可将顶层F棱和R棱的中块翻转。不考虑位置,颜色相同即可。第五步,顶面同色公 阅读全文
posted @ 2013-09-22 22:43 Devymex 阅读(4730) 评论(1) 推荐(1) 编辑

2013年9月19日

摘要: 一、问题这是一道历史悠久,又很困难的逻辑推理题,有的公司还会将其作为面试题。有人将其称为“鬼谷子问题”,但笔者至今没有找到任何可靠来源。先给出问题。你在旁观主持人和甲、乙两个天才数学家玩猜数字游戏。主持人准备了两个数,告知甲乙:这两个数不同,且大于等于1,小于等于30。然后主持人将两数之积告诉甲,把两数之和告诉乙。甲知道乙拿到两数之和,乙也知道甲拿到两数之积。主持人让甲乙猜这两个数字,让甲先发言。甲:“我不知道这两个数是什么”乙:“我也不知道”甲:“那我知道了”乙:“那我也知道了”请问你,这两个数是什么?另一种等价表述(即所谓的鬼谷子问题):一天,鬼谷子随意从2-99中选取了两个数。他把这两个 阅读全文
posted @ 2013-09-19 12:33 Devymex 阅读(23764) 评论(18) 推荐(4) 编辑

2013年9月17日

摘要: 模板元编程(英语:Template metaprogramming;缩写:TMP)是一种元编程技术,不夸张的说,这项技术开启了一种新的C++编程方式。编译器使用模板产生暂时性的源码,然后再和剩下的源码混合并编译。这些模板的输出包括编译时期常数、数据结构以及完整的函数。如此利用模板可以被想成编译期的运行。本文介绍了利用模板元编程技术实现在编译期判断一个整数是否为素数的算法。输入为一个大于0的整数,输出为1表示该整数为素数,为0表示为合数。本文的主要目的是用实例说明模板元编程实现算术和逻辑运算的一般设计和编写方法。 阅读全文
posted @ 2013-09-17 20:38 Devymex 阅读(2816) 评论(1) 推荐(0) 编辑

2013年8月26日

摘要: Time limit: 30.000 seconds限时30.000秒Problem问题A triangle is a basic shape of planar geometry. It consists of three straight lines and three angles in between. Figure 1 shows how the sides and angles are usually labeled. Figure: TriangleA look into a book about geometry shows that many formulas for tri 阅读全文
posted @ 2013-08-26 18:08 Devymex 阅读(1666) 评论(1) 推荐(0) 编辑

2013年8月22日

摘要: Time limit: 3.000 seconds限时3.000秒Problem问题Many researchers are faced with an ever increasing number of journal articles to read and find it difficult to locate papers of relevance to their particular lines of research. However, it is possible to subscribe to various services which claim that they wi 阅读全文
posted @ 2013-08-22 20:47 Devymex 阅读(1237) 评论(0) 推荐(0) 编辑

2013年8月20日

摘要: Time limit: 30.000 seconds限时30.000秒Problem问题There was once a 3 by 3 by 3 cube built of 27 smaller cubes. It has fallen apart into seven pieces:写曾经有一个3x3x3的立方块,由27个小立方块构成。它被切分为了如下七个碎片:Figure 1: The seven pieces that once formed a cube图1:组成立方体的七块碎片The seven pieces can be assembled in many ways to agai 阅读全文
posted @ 2013-08-20 18:34 Devymex 阅读(1842) 评论(0) 推荐(0) 编辑

2013年8月18日

摘要: Time limit: 3.000 seconds限时3.000秒Problem问题In darkest lived a tribe called the ``Eeny Meenys''. They got this name from their way of choosing a chief for a year. It appears that a newspaper reporter visited the tribe and managed to get across a few ideas of civilisation, but apparently came t 阅读全文
posted @ 2013-08-18 22:51 Devymex 阅读(862) 评论(0) 推荐(0) 编辑

2013年8月17日

摘要: Time limit: 3.000 seconds限时3.000秒Problem问题Given a graph (V,E) where V is a set of nodes and E is a set of arcs in VxV, and an ordering on the elements... 阅读全文
posted @ 2013-08-17 15:26 Devymex 阅读(2462) 评论(2) 推荐(0) 编辑

2012年3月10日

摘要: 可能不少在沙盘(Sandboxie)里运行QQ的同学都会遇到这样的问题:先把QQ装在沙盘里,然后把QQ的安装文件夹复制到另一个地方,清空沙盘,再从沙盘中启动QQ:经过排除法查找,确定这个问题是由于两个安全组件(COM)没有注册引起的。这两个组件的动态链接库文件分别是安装在以下目录的SSOCommon.dll和SSOPlatform.dllc:\program files\common\tencent\TXSSO\版本号\bin\为了解决这个问题,写了一个简单的QQ启动器,把它放在QQ的bin目录下,在沙盘里运行它就可以自动注册这两个组件,并自动启动QQ了。是代码附在下面仅供参考,编译需要项目文 阅读全文
posted @ 2012-03-10 20:11 Devymex 阅读(7235) 评论(0) 推荐(1) 编辑

2011年12月31日

摘要: 本文详细的介绍了在Visual Studio(以下简称VS)下实现API钩子的编程方法,阅读本文需要基础:有操作系统的基本知识(进程管理,内存管理),会在VS下编写和调试Win32应用程序和动态链接库(以下简称DLL)。API钩子是一种高级编程技巧,常常用来完成一些特别的功能,比如词典软件的屏幕取词... 阅读全文
posted @ 2011-12-31 13:21 Devymex 阅读(14042) 评论(12) 推荐(9) 编辑

2010年9月7日

摘要: Time limit: 3.000 seconds限时3.000秒Problem问题A computer programmer lives in a street with houses numbered consecutively (from 1) down one side of the street. Every evening she walks her dog by leaving her house and randomly turning left or right and walking to the end of the street and back. One night 阅读全文
posted @ 2010-09-07 00:58 Devymex 阅读(3003) 评论(0) 推荐(2) 编辑

2010年9月6日

摘要: (敬告:当您的浏览器以非默认字体浏览本文时,段落格式可能会出现偏差)这篇文章主要讲解如何在C++中使用cout进行高级的格式化输出操作,包括数字的各种计数法(精度)输出,左或右对齐,大小写等等。通过本文,您可以完全脱离scanf/printf,仅使用cout来完成一切需要的格式化输入输出功能(从非性能的角度而言)。更进一步而言,您还可以在<sstream>、<fstream>上使用这些格式化操作,从而代替sprintf和fprintf函数。为方便描述,下文仅以cout为例进行介绍。一、综述cout是STL库提供的一个iostream实例,拥有ios_base基类的全部函 阅读全文
posted @ 2010-09-06 12:08 Devymex 阅读(58645) 评论(7) 推荐(16) 编辑

摘要: Time limit: 3.000 seconds限时:3.000秒Problem问题Gondwanaland Telecom makes charges for calls according to distance and time of day. The basis of the charging is contained in the following schedule, where t... 阅读全文
posted @ 2010-09-06 07:46 Devymex 阅读(900) 评论(0) 推荐(0) 编辑

2010年9月4日

摘要: Time limit: 3.000 seconds限时:3.000秒Background and Problem背景与问题The historian Flavius Josephus relates how, in the Romano-Jewish conflict of 67 A.D., the Romans took the town of Jotapata which he was com... 阅读全文
posted @ 2010-09-04 15:18 Devymex 阅读(2553) 评论(1) 推荐(0) 编辑

2010年8月28日

摘要: Time limit: 3.000 seconds限时:3.000秒Problem问题You work for a company which uses lots of personal computers. Your boss, Dr Penny Pincher, has wanted to link the computers together for some time but has be... 阅读全文
posted @ 2010-08-28 04:50 Devymex 阅读(2203) 评论(1) 推荐(1) 编辑

2010年8月27日

摘要: Time limit: 3.000 seconds限时:3.000秒Problem问题New Zealand currency consists of $100, $50, $20, $10, and $5 notes and $2, $1, 50c, 20c, 10c and 5c coins. Write a program that will determine, for any given... 阅读全文
posted @ 2010-08-27 21:10 Devymex 阅读(2206) 评论(2) 推荐(1) 编辑

2010年8月26日

摘要: Time limit: 3.000 seconds限时:3.000秒Problem问题You are to simulate the playing of games of "Accordian" patience, the rules for which are as follows:模拟玩一个“手风琴”纸牌游戏,规则如下:Deal cards one by one in... 阅读全文
posted @ 2010-08-26 23:15 Devymex 阅读(6333) 评论(2) 推荐(1) 编辑

摘要: #IDTitleSolved byDifficulty1100The 3n + 1 problem2648512102Ecological Bin Packing106082310071Back to High School Physics95543410055Hashmat the Brave Warrior943235272TEX Quotes819236458The Decoder72894... 阅读全文
posted @ 2010-08-26 01:58 Devymex 阅读(14429) 评论(1) 推荐(3) 编辑

2010年8月24日

摘要: Time limit: 3.000 seconds限时:3.000秒Problem问题You have been employed by the organisers of a Super Krypton Factor Contest in which contestants have very high mental and physical abilities. In one section ... 阅读全文
posted @ 2010-08-24 23:57 Devymex 阅读(2717) 评论(3) 推荐(0) 编辑

摘要: Problem问题A typical windowing system on a computer will provide a number of icons on the screen as well as some defined regions. When the mouse button is clicked, the system has to determine where the ... 阅读全文
posted @ 2010-08-24 19:34 Devymex 阅读(1204) 评论(0) 推荐(0) 编辑

摘要: Time limit: 3.000 seconds限时:3.000秒Problem问题It is often fun to see if rearranging the letters of a name gives an amusing anagram. For example, the letters of 'WILLIAM SHAKESPEARE' rearrange to form 'SP... 阅读全文
posted @ 2010-08-24 14:03 Devymex 阅读(2306) 评论(4) 推荐(2) 编辑

摘要: Time limit: 3.000 seconds限时:3.000秒Problem问题An Orchardist has planted an orchard in a rectangle with trees uniformly spaced in both directions. Thus the trees form a rectangular grid and we can conside... 阅读全文
posted @ 2010-08-24 01:11 Devymex 阅读(1280) 评论(0) 推荐(0) 编辑

2010年8月23日

摘要: Time limit: 3.000 seconds限时:3.000秒Problem问题In engineering sciences, partial differential equations play an important and central role. For example, the temperature of a metal plate can be expressed as... 阅读全文
posted @ 2010-08-23 20:49 Devymex 阅读(1263) 评论(1) 推荐(0) 编辑

摘要: Problem问题Loglan is a synthetic speakable language designed to test some of the fundamental problems of linguistics, such as the Sapir Whorf hypothesis. It is syntactically unambiguous, culturally neut... 阅读全文
posted @ 2010-08-23 05:20 Devymex 阅读(1877) 评论(5) 推荐(4) 编辑

2010年8月22日

摘要: Problem问题A large company wishes to monitor the cost of phone calls made by its personnel. To achieve this the PABX logs, for each call, the number called (a string of up to 15 digits) and the duration... 阅读全文
posted @ 2010-08-22 17:59 Devymex 阅读(856) 评论(0) 推荐(0) 编辑

2010年8月21日

摘要: Time limit: 3.000 seconds限时3.000秒Background and Problem背景与问题In 45 BC a standard calendar was adopted by Julius Caesar--each year would have 365 days, and every fourth year have an extra day--the 29th ... 阅读全文
posted @ 2010-08-21 22:51 Devymex 阅读(2020) 评论(2) 推荐(1) 编辑

2010年8月20日

摘要: Problem问题Consider a grid such as the one shown. We wish to mark k intersections in each of n rows and n columns in such a way that no 4 of the selected intersections form a rectangle with sides parall... 阅读全文
posted @ 2010-08-20 23:40 Devymex 阅读(1576) 评论(0) 推荐(0) 编辑

摘要: Time limit: 3.000 seconds限时:3.000秒Problem问题Consider objects such as these. They are polygons, specified by the coordinates of a centre of mass and their vertices. In the figure, centres of mass are sh... 阅读全文
posted @ 2010-08-20 19:26 Devymex 阅读(1352) 评论(0) 推荐(0) 编辑

摘要: Time limit: 3.000 seconds限时:3.000秒Problem问题Given two convex polygons, they may or may not overlap. If they do overlap, they will do so to differing degrees and in different ways. Write a program that ... 阅读全文
posted @ 2010-08-20 14:12 Devymex 阅读(3070) 评论(4) 推荐(1) 编辑

2010年8月19日

摘要: 概念平面内两条线段位置关系的判定在很多领域都有着广泛的应用,比如游戏、CAD、图形处理等,而两线段交点的求解又是该算法中重要的一环。本文将尽可能用通俗的语言详细的描述一种主流且性能较高的判定算法。外积,又称叉积,是向量代数(解析几何)中的一个概念。两个二维向量v1(x1, y1)和v2(x2, y2)的外积v1×v2=x1y2-y1x2。如果由v1到v2是顺时针转动,外积为负,反之为正,为0表示二者方向相同(平行)。此外,文中涉及行例式和方程组的概念,请参阅线性代数的相关内容。为方便计算,对坐标点的大小比较作如下定义:x坐标较大的点为大,x坐标相等但y坐标较大的为大,x与y都相等的点 阅读全文
posted @ 2010-08-19 21:44 Devymex 阅读(23829) 评论(10) 推荐(5) 编辑