上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页

2013年5月13日

HDU 1087 Super Jumping! Jumping! Jumping! 动态规划

摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087Super Jumping! Jumping! Jumping!Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good b 阅读全文

posted @ 2013-05-13 21:00 圣手摘星 阅读(151) 评论(0) 推荐(0) 编辑

2013年5月12日

2013ACM/ICPC湘潭多省程序设计竞赛暨湘潭市第五届大学生程序设计竞赛

摘要: Hurry Up题目链接:http://202.197.224.59/OnlineJudge2/index.php/Problem/read/id/1175解题思路:一道三分搜索的水题,可直接使用模板!解题代码:View Code 1 // File Name: Hurry Up 2 // Author: sheng 3 // Created Time: 2013年05月12日 星期日 20时36分10秒 4 5 #include <stdio.h> 6 #include <string.h> 7 #include <math.h> 8 #include & 阅读全文

posted @ 2013-05-12 21:51 圣手摘星 阅读(230) 评论(0) 推荐(0) 编辑

三分搜索

摘要: 一. 概念在二分查找的基础上,在右区间(或左区间)再进行一次二分,这样的查找算法称为三分查找,也就是三分法。三分查找通常用来迅速确定最值。二分查找所面向的搜索序列的要求是:具有单调性(不一定严格单调);没有单调性的序列不是使用二分查找。与二分查找不同的是,三分法所面向的搜索序列的要求是:序列为一个凸性函数。通俗来讲,就是该序列必须有一个最大值(或最小值),在最大值(最小值)的左侧序列,必须满足不严格单调递增(递减),右侧序列必须满足不严格单调递减(递增)。如下图,表示一个有最大值的凸性函数:二、算法过程(1)、与二分法类似,先取整个区间的中间值mid。1 mid = (left + right 阅读全文

posted @ 2013-05-12 20:21 圣手摘星 阅读(285) 评论(0) 推荐(0) 编辑

ZOJ 三分搜索 3203 Light Bulb

摘要: Light BulbTime Limit:1 Second Memory Limit:32768 KB链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3366Compared to wildleopard's wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb in his house. Every night, he is wandering in his 阅读全文

posted @ 2013-05-12 20:12 圣手摘星 阅读(121) 评论(0) 推荐(0) 编辑

2013年5月9日

求N!的另一种方法

摘要: 1 // File Name: text.cpp 2 // Author: sheng 3 // Created Time: 2013年05月09日 星期四 20时02分44秒 4 5 #include <iostream> 6 #include <stdio.h> 7 #include <math.h> 8 #include <string.h> 9 using namespace std;10 11 const long long max_n = 1 << 20;12 long long f[max_n];13 long long 阅读全文

posted @ 2013-05-09 20:53 圣手摘星 阅读(169) 评论(0) 推荐(0) 编辑

hdu 1069 Monkey and Banana

摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1069Monkey and BananaTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5272Accepted Submission(s): 2702Problem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. Th 阅读全文

posted @ 2013-05-09 13:14 圣手摘星 阅读(160) 评论(0) 推荐(0) 编辑

2013年5月1日

HDU 1024 MAX sum plus plus 动态规划

摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1024Max Sum Plus PlusTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12181Accepted Submission(s): 4024Problem DescriptionNow I think you have got an AC in Ignatius.L's "Max Sum" problem. 阅读全文

posted @ 2013-05-01 20:40 圣手摘星 阅读(166) 评论(0) 推荐(0) 编辑

2013年4月30日

ubuntu vbox虚拟机 共享文件

摘要: UBUNTU下与 VBOX内的XP进行文件共享 1. 在主机中执行 VBoxManage sharedfolder add "VM name" -name "sharename" -hostpath "test" 该命令中的 VM name 指定要使用共享文件夹的虚拟机名称,如 WinXP;sharename 为共享的文件夹名称,可任意设置。test 为主机上需要共享的文件夹。 例子:VBoxManage sharedfolder add "xp" -name "公共的" -hostpath & 阅读全文

posted @ 2013-04-30 11:18 圣手摘星 阅读(392) 评论(0) 推荐(0) 编辑

2013年4月29日

ubuntu 12.04 软件源

摘要: 1、首先备份Ubuntu12.04源列表sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup (备份下当前的源列表)2、修改更新源sudo gedit /etc/apt/sources.list (打开Ubuntu 12.04源列表文件)3、把里面的列表替换成下面的列表163源deb http://mirrors.163.com/ubuntu/ precise main restricteddeb-src http://mirrors.163.com/ubuntu/ precise main restricteddeb http: 阅读全文

posted @ 2013-04-29 19:07 圣手摘星 阅读(1415) 评论(0) 推荐(0) 编辑

2013年4月28日

C++ map 映照容器(ctrl+C & ctrl+V)

摘要: 原文地址:http://www.cppblog.com/vontroy/archive/2010/05/16/115501.htmlmap映照容器的元素数据是一个键值和一个映照数据组成的,键值与映照数据之间具有一一映照的关系。map映照容器的数据结构是采用红黑树来实现的,插入键值的元素不允许重复,比较函数只对元素的键值进行比较,元素的各项数据可通过键值检索出来。 使用map容器需要头文件包含语句“#include<map>”, map文件也包含了对multimap多重映照容器的定义。1、map创建、元素插入和遍历访问创建map对象,键值与映照数据的类型由自己定义。在没有指定比较函数 阅读全文

posted @ 2013-04-28 20:29 圣手摘星 阅读(355) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页

导航