- 博客(25)
- 收藏
- 关注
原创 topcoder SRM495 div1 level3
Problem Statement When cat Taro went to an internship, he found a strange elevator in the office's skyscraper. The skyscraper contains 58 floors. The elevator is composed of 2 boxes and thes
2012-05-28 14:05:50 737
原创 topcoder SRM495 div1 level2
Problem Statement There are N boxes numbered 0 through N-1. Every box except for one contains carrots, but Rabbit Hanako does not know which box is the empty one. Each box has the same proba
2012-05-28 13:54:07 632
原创 jupiter软件--解决ubuntu在笔记本上耗电大的问题
Jupiter 是一个专用于笔记本及上网本的小工具,功能是节省用电量。用户可以用它来在“全速/高性能/省电“三种模式之间自由切换,并可以进行分辨率设置等操作。在某种工作模式下,它会自动启用/禁用蓝牙、触摸板、WIFI 等设备,以便达到省电效果,同时它还支持 Asus EeePC 的 Super Hybrid Engine (SHE) 功能。近日 Jupiter 发布了最新 0.0.50 版,在
2012-05-25 17:53:20 5889
原创 topcoder SRM 492 div2 level3
A traveling salesman wants to survey N cities for business opportunities. The cities are numbered 0 throughN-1, and he wishes to visit each of them at least once. He starts at city 0 and can end at an
2012-05-25 17:47:12 552
原创 SRM 492 div1 level 2
There is a kingdom with N cities numbered 0 throughN-1. Gogo wants to survey several cities in the kingdom. These cities are described in int[]cities containing M elements. He wishes to survey cit
2012-05-25 17:44:04 564
原创 SRM 492 div1level1
There are N trees arranged in a straight horizontal line. They are numbered 0 through N-1 from left to right. The distance between tree i and tree (i+1) is distance[i], and the initial vertical height
2012-05-25 17:39:37 420
转载 使用MbrFix软件卸载Linux系统
不用Windows系统安装盘,不用安装矮人DOS工具箱也可以很简单地实现卸载Linux。双系统卸载Linux的主要问题是当在windows中将linux 分区直接格式化之后,Grub系统引导程序也会被同时删除,所以导致重启后无法进入Windows 或Linux任何一个系统。因此卸载linux之前,先修复MBR,然后再删除Linux分区就可以了。而MbrFix.exe 就是这样一个W
2012-05-24 14:47:26 1005
原创 Linux下软件的安装与卸载
在Windows下安装软件时,只需运行软件的安装程序(setup、install等)或者用zip等解压缩软件解开即可安装,运行反安装程序 (uninstall、unware、“卸载”等)就能将软件清除干净,完全图形化的操作界面,简单到只要用鼠标一直点击“下一步”就可以了。而 Linux好象就不一样了,很多的初学者都抱怨在Linux下安装和卸载软件非常地困难,没有像使用Windows时那么直观。其实
2012-05-24 14:44:38 464
原创 topcoder SRM 501 div1 level1
Problem Statement Fox Ciel was very bored, so she invented a single player game. The rules of the game are:You start with 0 points. You make exactly nA+nB moves. You have two ty
2012-05-19 10:44:00 599
原创 topcoder SRM 500 div2 level3
Problem Statement NOTE: This problem statement contains superscripts that may not display properly if viewed outside of the applet.You are given two geometric progressions S1 = (b1*q1i,
2012-05-19 10:41:14 491
原创 topcoder SRM div 2 level 1
Problem Statement Dmitry likes TopCoder Single Round Matches. Once, he registered for an SRM and was waiting for the coding phase to begin. To entertain himself while waiting, he decided to
2012-05-19 10:38:38 716
原创 topcoder SRM500 div1 Level3
Problem Statement NOTE: This problem statement contains superscripts that may not display properly if viewed outside of the applet.A positive integer is called nice if the sum of its di
2012-05-19 10:36:40 996
原创 topcoder SRM500 DIV1 LEVEL1 250分题
Problem Statement N friends (numbered from 0 to N-1) play a game called Mafia. The exact rules of the game are not important for this problem. What's important is that at some point in the
2012-05-14 17:08:46 713
原创 topcoder SRM500 DIV1 level2 500分
Problem Statement Nick likes to draw fractals. For the special occasion of Single Round Match 500, he decided to draw the 500th generation of his favorite fractal.Each generation of the
2012-05-14 16:47:23 695
原创 poj 1180 dp 斜率优化
【题意】N个任务排成一个序列在一台机器上等待完成(顺序不得改变),这N个任务被分成若干批,每批包含相邻的若干任务。 从时刻0开始,这些任务被分批加工,第i个任务单独完成所需的时间是Ti。在每批任务开始前,机器需要启动时间S,而完成这批任务所需的时间是各个任务需 要时间的总和(同一批任务将在同一时刻完成)。每个任务的费用是它的完成时刻乘以一个费用系数Fi。请确定一个分组方案,使得总费用最小。(1
2012-05-08 10:50:10 1991 2
转载 poj 1160 谈四边形不等式
转自:http://www.cnblogs.com/staginner/archive/2012/03/12/2391925.html 我们可以用f[i][j]表示建好i个邮局时覆盖到第j个村庄的最优解,那么就可以得到f[i][j]=min{f[i-1][k]+w[k+1][j]}(k 这个题目还可以用四边形不等式去优化,实际上四边形不等式优化难点不在于应用,只是在
2012-05-07 14:52:47 3927
原创 poj 3683 2-SAT 拓扑排序输出
【题意】有n个婚礼,每个婚礼有起始时间si,结束时间ti,还有一个主持时间ti,ti必须安排在婚礼的开始或者结束,主持由祭祀来做,但是只有一个祭祀,所以各个婚礼的主持时间不能重复,问你有没有可能正常的安排主持时间,不能输出no,能的话要输出具体的答案:即每个婚礼的主持时间段是什么样的。【题解】2-SAT判定问题,建图很简单,此略。重点讲一下输出方案。我们可以把处在同一个强连
2012-05-07 11:17:57 1722
原创 poj 3623 贪心,后缀数组
【题意】给你一个字符串,现在要生成一个新的字符串,规则是每次从原字符串的头部或者尾部取一个字符放在新字符串的尾巴上。求字典序最小的新字符串。 【题解】简单贪心,用后缀数组即可。贡献了两个presantation error T_T【代码】#include using namespace std;const int maxn=60010;int wa[maxn]
2012-05-06 15:28:28 671
原创 poj 3660 传递闭包
【题意】牛之间有绝对的强弱,给出一些胜负关系,问有多少头牛可以确定其绝对排名。【题解】先传递闭包,入度+出度==n-1的满足条件。【代码】#include using namespace std;const int maxn=105;bool f[maxn][maxn];int b[maxn];int n,m,ans;int main(){ in
2012-05-06 15:24:22 478
原创 poj 1988 并查集
【题意】有几个stack,初始里面有一个cube。支持两种操作:1.move x y: 将x所在的stack移动到y所在stack的顶部。2.count x:数在x所在stack中,在x之下的cube的个数。【题解】并查集。与银河英雄传说类似。维护两个量s[x]和d[x],表示子树大小和到根的距离。详情看代码:#include using namespace st
2012-05-05 09:46:52 2358 2
原创 poj 3415 后缀数组+栈优化
【题意】统计两个串中长度>=k的公共子串的数量。【题解】很容易想到将两个串连接起来,求后缀数组,在根据k分组但统计是件麻烦事。。。以下是我自己搞出来的方法:搞一个单调的栈维护lcp,然后维护单调性。统计的时候要注意,只有不同的串的lcp才能统计。这个方法严格的来说不能算是O(n),但是很接近。结合代码分析:long long work(){
2012-05-04 16:19:06 1242
原创 poj 3525 求凸多边形的最大内切圆
【题意】凸多边形的最大内切圆【题解】二分+半平面交判定。【代码】#include #include #define eps 1e-8#define oo 1e5using namespace std;const int maxn=105;struct point{ double x,y; point() {} poi
2012-05-04 10:28:07 4869 1
原创 poj 1474 半平面交求多边形的核
【题意】是否能在房间中找到一个位置来安装摄像头,使摄像头能监控到房间的每个角落。在平面图上,房间的墙只有横和竖的,没有斜的。【题解】判断多边形是否存在核。用半平面交判断。【代码】#include #include #define eps 1e-8#define oo 1e5using namespace std;const int maxn=105;struc
2012-05-03 13:55:09 1354
原创 poj 2187 求凸包最远点对--旋转卡壳
【题意】求最远点对【题解】凸包+旋转卡壳没学过旋转卡壳的,提供一个链接http://www.cnblogs.com/DreamUp/archive/2010/09/16/1828131.html【代码】#include #include #include using namespace std;const int maxn=100003;struct poi
2012-05-03 09:01:49 786
原创 poj 2778 AC自动机DP
从AC了poj1625 censored!一题后,又解决了一道AC自动机DP题。【题意】同poj 1625【题解】poj 1625是dp,而这道题的DP通过矩阵实现。【代码】#include #include using namespace std;const int maxn=100,base=100000,kind=4;struct node{
2012-05-02 15:05:28 662
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人