- 博客(122)
- 资源 (16)
- 收藏
- 关注
原创 隐式图--UVA - 1601 The Morning after Halloween
分析:以当前3个小写字母的位置为状态,则问题转化为图的最短路问题。状态总数为256^3,每次转移需要5^3枚举每个小写字母下一步的走法,但是容易超时。由条件“任何一个2×2子网格中至少有一个障碍格”暗示着很多格子都是障碍,并且大部分空地都和障碍相邻,因此不是所有4个方向都能移动,因此可以把所有空格提出来建一个图。这里将原图中的空白点映射为编号,再将三个点的编号合一。预处理可以把每个空白格子的5个方
2015-10-31 19:22:27 580
原创 隐式图--UVA - 10603 Fill
分析:假设在某个时刻,第1个杯子中有v0升水,第2个杯子中有v1升水,第3个杯子中有v2升水,称当时的系统状态为(v0,v1,v2);把‘状态’看成图中的结点,可以得到状态转移图;由于无论如何倒,杯子中的水量都是整数,因此第3个杯子的水量最多只有0,1,2,3 ... ,c共c+1种可能,同理,第2个杯子的水量共有b+1种可能;而一旦两个杯子的水量一样了,则第三个杯子水量也一样,所以最多的状态不会
2015-10-31 13:48:21 725
原创 八数码--HDU - 1043 Eight
DescriptionThe 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it,
2015-10-31 11:44:19 415
原创 贪心--HDU - 4221 Greedy?
DescriptioniSea is going to be CRAZY! Recently, he was assigned a lot of works to do, so many that you can't imagine. Each task costs Ci time as least, and the worst news is, he must do this work
2015-10-31 00:42:09 1032
原创 贪心--HDU - 4310 Hero
DescriptionWhen playing DotA with god-like rivals and pig-like team members, you have to face an embarrassing situation: All your teammates are killed, and you have to fight 1vN. There are two
2015-10-31 00:14:54 577
原创 贪心-- HDU - 4296 Buildings
Description Have you ever heard the story of Blue.Mary, the great civil engineer? Unlike Mr. Wolowitz, Dr. Blue.Mary has accomplished many great projects, one of which is the Guanghua Building.
2015-10-30 23:56:06 631
原创 贪心--HDU - 4442 Physical Examination
InputThere are several test cases. Each test case starts with a positive integer n in a line, meaning the number of subjects(queues). Then n lines follow. The i-th line has a pair of integers (a
2015-10-30 23:16:40 530
原创 ZOJ - 1489 2^x mod n = 1
DescriptionGive a number n, find the minimum x that satisfies 2^x mod n = 1.InputOne positive integer on each line, the value of n.OutputIf the minimum x ex
2015-10-30 22:01:38 515
原创 哈希--ZOJ - 3844 Easy Task
DescriptionYou are given n integers. Your task is very easy. You should find the maximum integer a and the minimum integer b among these nintegers. And then you should replace both a and b with a-
2015-10-30 20:58:53 520
原创 凸包--HDU - 3285 Convex Hull of Lattice Points
DescriptionA lattice point is a point with integer coordinates. A lattice polygon is a polygon with all vertices lattice points. A polygon is convex if any line segment between two points of t
2015-10-29 15:11:50 694
原创 并查集--HDU - 3926 Hand in Hand
DescriptionIn order to get rid of Conan, Kaitou KID disguises himself as a teacher in the kindergarten. He knows kids love games and works out a new game called "hand in hand". Initially kids
2015-10-29 11:37:33 479
原创 Linux操作系统中,*.zip、*.tar、*.tar.gz、*.tar.bz2、*.tar.xz、*.jar、*.7z等格式的压缩与解压
zip格式压缩: zip -r [目标文件名].zip [原文件/目录名]解压: unzip [原文件名].zip注:-r参数代表递归tar格式(该格式仅仅打包,不压缩)打包:tar -cvf [目标文件名].tar [原文件名/目录名]解包:tar -xvf [原文件名].tar注:c参数代表create(创建),x参数代表extract(解包
2015-10-29 10:55:47 4672 1
原创 并查集-- HDU - 4263 Red/Blue Spanning Tree
DescriptionGiven an undirected, unweighted, connected graph, where each edge is colored either blue or red, determine whether a spanning tree with exactly k blue edges exists. Input
2015-10-29 10:23:02 588
原创 并查集--HDU - 4313 Matrix
DescriptionMachines have once again attacked the kingdom of Xions. The kingdom of Xions has N cities and N-1 bidirectional roads. The road network is such that there is a unique path between any
2015-10-29 09:29:51 593
原创 并查集--HDU - 4496 D-City
DescriptionLuxer is a really bad guy. He destroys everything he met. One day Luxer went to D-city. D-city has N D-points and M D-lines. Each D-line connects exactly two D-points. Luxer will dest
2015-10-29 08:41:50 528
原创 并查集--POJ - 2524 Ubiquitous Religions
Description当今世界有很多不同的宗教,很难通晓他们。你有兴趣找出在你的大学里有多少种不同的宗教信仰。你知道在你的大学里有n个学生(0 Input有多组数据。对于每组数据:第一行:两个整数n和m。以下m行:每行包含两个整数i和j,表示学生i和j信仰相同的宗教。学生编号从1到n。输入的最后一行中,n = m = 0。Ou
2015-10-28 23:51:45 431
原创 并查集--POJ - 1611 The Suspects
Description严重急性呼吸系统综合症( SARS), 一种原因不明的非典型性肺炎,从2003年3月中旬开始被认为是全球威胁。为了减少传播给别人的机会, 最好的策略是隔离可能的患者。在Not-Spreading-Your-Sickness大学( NSYSU), 有许多学生团体。同一组的学生经常彼此相通,一个学生可以同时加入几个小组。为了防止非典的传播,NSYSU收集了所有学生团体
2015-10-28 00:24:34 565
原创 精华--CentOS多网卡配置
事情是这样的,我之前在windows用vmware建了一个centos,现在ubuntu开发,要用到之前的虚拟机,所以下了个vmware10, 因为文件格式来自于同一款软件,所以ubuntu下可以使用windows创建的虚拟机。顺利开机让我略感兴奋,当我配置完ssh后发现ip地址变了,然后我决定配置为静态的ip,重启网络时报错:没有找到合适的设备,没有找到可用于连接‘Auto_eth0'的设备
2015-10-26 10:00:58 2003
原创 Linux回收站管理
linux下的回收站在每一个当前用户目录./local/share/Trash中 ($HOME/.local/share/Trash/files/*)也可以给linux添加一个回收站。1、mkdir /tmp/trash_tmp 建立一个回收站目录2、vi /bin/trash 编辑一个文件#!/bin/shmv $@ /tmp/trash_tmp:wq 保存退出3、
2015-10-26 08:23:11 1086
原创 详解Linux中SSH远程访问控制
SSH:是一种安全通道协议,主要用来实现字符界面的远程登录,远程复制等功能(使用TCP的22号端口)。SSH协议对通信双方的数据传输进行了加密处理,其中包括用户登录时输入的用户口令。在RHEL 5系统中使用的是OpenSSH服务器由openssh,openssh-server等软件包提供的(默认已经安装),并以将sshd添加为标准的系统服务。推荐阅读:通过配置SSH深刻理解
2015-10-25 23:34:44 893
原创 Ubuntu软件安装卸载查看方法
说明:由于图形化界面方法(如Add/Remove... 和Synaptic Package Manageer)比较简单,所以这里主要总结在终端通过命令行方式进行的软件包安装、卸载和删除的方法。一、Ubuntu中软件安装方法1、APT方式(1)普通安装:apt-get install softname1 softname2 …;(2)修复安装:apt-get -f i
2015-10-25 17:31:11 639
原创 UVA - 140 Bandwidth
DescriptionGiven 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 in V, then the bandwidth of a node v is defined as the maximum distance
2015-10-25 12:23:00 384
原创 UVA - 129 Krypton Factor
DescriptionYou 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 of the contest the conte
2015-10-24 21:16:51 485
原创 regular polygon can be drawn only by straightedge and compass
DescriptionYour task is to judge whether a regular polygon can be drawn only by straightedge and compass.The length of the straightedge is infinite.The width of the compass is infinite.The s
2015-10-24 18:53:58 421
原创 HDU - 1010 Tempter of the Bone
DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized
2015-10-24 00:31:23 349
原创 HDU - 1042 N!
DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N! InputOne N in one line, process to the end of file. OutputFor each N, output N! in
2015-10-23 21:26:45 402
原创 UVA_100: The 3n + 1 problem
DescriptionProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an a
2015-10-23 18:07:07 539
原创 UVA - 11054 Wine trading in Gergovia
原题链接分析:考虑最左边的村庄1,若a1>0,则村庄2必会给村庄1送酒,不管这些酒从哪里来。同理,对于左边的村庄,酒的需求是a1+..+ai,这些需求必然来于右边,那么运送成本即需求的绝对值,而当前的需求即左边村庄的需求加上当前村庄的需求。#include #include using namespace std;int main(){ int n; whi
2015-10-23 13:19:56 502
原创 UVA - 11134 Fabled Rooks
题目大意:在一个n*n的棋盘上放置n个车,使得它们之间都不能互相攻击(任意两个车都不能同行或同列),并且,对于第i个车,限制它只能放在一个矩形区域内,(xli, yli),这个矩形的左上角顶点坐标是(xli, yli),右下角顶点坐标是 (xri, yri), 1 ≤ i ≤ n,1 ≤ xli ≤ xri ≤ n,1 ≤ yli ≤ yri ≤ n.思路:
2015-10-22 22:21:43 480
原创 UVA - 1152 4 Values whose Sum is 0
题目大意:在4个都有n个元素的集合中,每个集合选出一个元素,使得4个数和为0。问有几种方案。题目分析:开始想到暴力枚举,对四组数枚举,复杂度O(n^4)无法接受,后来对前三组数枚举累加,在第四组中找和的个数,如果对第四组数据排序并二分查找,算法复杂度为O(n^3 logn)无法接受;最后采用二分。任选两组求和,剩下两组求和,枚举第一组中 每一个和sum,在第二组和中查找-sum的个数,
2015-10-22 10:57:06 522
原创 UVA_1605: Building for UN
DescriptionThe United Nations has decided to build a new headquarters in Saint Petersburg, Russia. It will have a form of a rectangular parallelepiped and will consist of several rectangular floor
2015-10-21 23:39:53 559
原创 UVA - 120 Stacks of Flapjacks
DescriptionBackgroundStacks and Queues are often considered the bread and butter of data structures and find use in architecture, parsing, operating systems, and discrete event simulation.
2015-10-21 22:27:59 498
原创 分治——循环赛日程表
问题描述:有n个运动员进行循环赛,要求设计满足一下要求的日程表1、 每两人必须比赛一次且只比赛一次2、 每个选手每天只能比赛一次3、 n=2^k分析:方格可以分成4部分,左上和右下一样,左下和右上一样;左下=左上+(1#include #include using namespace std;const int maxn = 14;
2015-10-21 15:44:38 693
原创 ZOJ - 1029 Moving Tables
DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure.The floor has 200 rooms each on the north side and south sid
2015-10-21 15:22:27 695
原创 ZOJ - 1633 Big String
DescriptionWe will construct an infinitely long string from two short strings: A = "^__^" (four characters), and B = "T.T" (three characters). Repeat the following steps:Concatenate A after B
2015-10-21 14:44:23 751
原创 The virtual machine 'xp' has terminated unexpectedly during startup with exit code 1.
最近升级了内核,突然不能打开虚拟机,提示The virtual machine 'xp' has terminated unexpectedly during startup with exit code 1.返回 代码:NS_ERROR_FAILURE (0x80004005)组件:Machine界面:IMachine {662c175e-a69d-40b8-a7
2015-10-21 13:27:43 16977 2
原创 信息学奥赛辅导 残缺棋盘——分治算法
/* 残缺棋盘一个有2k×2k个方格的棋盘,其中恰有一个方格残缺。在残缺棋盘问题中,要求用三格板(triominoes)覆盖残缺棋盘。在此覆盖中,两个三格板不能重叠。三格板不能覆盖残缺方格,但必须覆盖其他所有的方格。在这种限制条件下,所需要的三格板总数为(22k-1)/3 ,可以验证(22k-1)/3是一个整数。2k×2k棋盘一个很自然的划分方法就是将它划分为4个2k-1×2k-1棋
2015-10-19 23:38:26 1585
原创 Linux开机自动挂载Windows分区的两种方法
使用Linux的朋友肯定都不会对本文所谈的内容陌生,在Linux系统里,通常不会开机自动挂载Windows文件系统下的分区。Ubuntu系统下要点击Windows分区才会挂载,Fedora下则甚至要输入root密码才能打开。 我总结了两种方法实现Windows分区的自动挂载。(如果不知道文件所在分区可以用 df -h filename 查看,磁盘详细分区信息用 sudo fdisk -l
2015-10-19 09:39:37 1447
原创 CentOS6.5 添加用户到 sudoers
在装完系统后,CentOS默认普通用户是无法使用sudo命令的,这时我们就需要将登陆的用户加入/etc/sudoers 文件中假设用户名是tom切换到超级用户:$ su -打开/etc/sudoers文件:$vi /etc/sudoers修改文件内容:找到root ALL=(ALL
2015-10-18 22:22:04 1622
原创 UVA - 12166 Equilibrium Mobile
A mobile is a type of kinetic sculpture constructed to take advantage of the principle of equilibrium. It consists of a number of rods, from which weighted objects or further rods hang. The objects ha
2015-10-17 00:42:11 684 1
统计学习方法 (李航)
2017-04-15
机器学习实战(英文+中文PDF+源码)
2017-04-15
PEview.exe
2016-04-08
修复windows7系统主题
2015-07-31
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人