首页 > 其他
poj2594 (最小路径覆盖 + floyd)
题目链接题目大意: 一个有向图中, 有若干条连接的路线, 问最少放多少个机器人,可以将整个图上的点都走过。 最小路径覆盖问题。分析: 这时最小路径覆盖问题, 最小路径覆盖 = |V| - 最大匹配数。 (有关最小路径覆盖,最大匹配问题,相关概念不懂得点这里) 当然做这道题还有一个坑!! 如果有向图的边有相交的情况,那么就不能简单的对原图求二分匹配了 详细讲解看这 #include<iost...
分类:其他   时间:2015-06-03 10:03:27    收藏:0  评论:0  赞:0  阅读:85
HDU 3038 How Many Answers Are Wrong 带权并查集
How Many Answers Are Wrong Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3472    Accepted Submission(s): 1326 Problem Description TT...
分类:其他   时间:2015-06-03 10:03:18    收藏:0  评论:0  赞:0  阅读:156
LeetCode 18: 4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: Elements ...
分类:其他   时间:2015-06-03 10:02:08    收藏:0  评论:0  赞:0  阅读:184
LeetCode 19: Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the l...
分类:其他   时间:2015-06-03 10:01:38    收藏:0  评论:0  赞:0  阅读:187
LeetCode 20: Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all valid b...
分类:其他   时间:2015-06-03 10:01:30    收藏:0  评论:0  赞:0  阅读:251
Beat the Spread!
这水题也是用了不少时间。...
分类:其他   时间:2015-06-03 10:01:29    收藏:0  评论:0  赞:0  阅读:134
题目1004:Median
题目描述:     Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16, 17}...
分类:其他   时间:2015-06-03 10:00:18    收藏:0  评论:0  赞:0  阅读:141
centos 7 配置iptables开放80端口
centos7默认的是用firewalld进行管理防火墙的。 在安装完centos7后,安装了nginx服务器,但是同在一个局域网却访问不到,哥哥告诉我应该是防火墙开了。将防火墙关了就可以了。 果断一试。 但是每次防火墙总是自起动。 然后哥哥告诉我两种选择,要么继续用firewalld进行管理,要么用iptables。 在之前用的都是iptables,升级到7后,将firewalld换成...
分类:其他   时间:2015-06-03 09:59:37    收藏:0  评论:0  赞:0  阅读:203
《哈佛通识教育红皮书》 哈佛委员会著
哈佛委员会著 【内容简介】 1943年,哈佛大学众多学科领域里的12位著名教授组成委员会,旨在对“民主社会中的通识教育目标问题”进行研究。该委员会历经两年的潜心研究后,形成了以“民主社会中的通识教育”为题的总结报告,1945年由哈佛大学出版社出版,俗称“红皮书”。 【序言】 1.《哈佛通识教育红皮书》有助于我们在教育哲学层面上正确的理解高等教育要培养什么样的人以及如何培养这样的人才...
分类:其他   时间:2015-06-03 09:59:08    收藏:0  评论:0  赞:0  阅读:120
hbase 概念 + 搭建分布式HA应用
HBase - Hadoop Database hbase的设计思想来自于google的bigtable 主键:Row Key 主键是用来检索记录的主键,访问Hbase table 中的行,只有三种方式 通过单个Row Key 访问 通过Row Key 的range 全表扫描 列族:Column Family 列族...
分类:其他   时间:2015-06-03 09:58:57    收藏:0  评论:0  赞:0  阅读:257
Project Euler:Problem 29 Distinct powers
Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5: 22=4, 23=8, 24=16, 25=32 32=9, 33=27, 34=81, 35=243 42=16, 43=64, 44=256, 45=1024 52=25, 53=125, 54=625, 55=3125 If they a...
分类:其他   时间:2015-06-03 09:58:38    收藏:0  评论:0  赞:0  阅读:174
Project Euler:Problem 30 Digit fifth powers
Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits: 1634 = 14 + 64 + 34 + 44 8208 = 84 + 24 + 04 + 84 9474 = 94 + 44 + 74 + 44 As 1 = 14 ...
分类:其他   时间:2015-06-03 09:58:33    收藏:0  评论:0  赞:0  阅读:135
HDFS写文件解析
client通过DistributedFileSystem对象调用create()方法创建文件,实际上通过RPC调用了NameNode的方法。NameNode收到client的请求之后,执行各种检查(1.确认要传文件目前在HDFS上不存在,2.client具有写的权限)如果通过则会为新文件创建一条记录,并返回一个FSDataOutputStream对象,该对象负责DataNode和NameNode...
分类:其他   时间:2015-06-03 09:58:32    收藏:0  评论:0  赞:0  阅读:162
lightOj 1132(矩阵快速幂)
题意:求式子(1^K + 2^K + 3^K + … + N^K) % 2^32,给出N和K,1<=n <=10^15, 1 <= k <= 50。 题解:可以看到N很大,数组肯定开不下,只能从K入手,让f(x + 1) = f(x) + (x + 1) ^k,x从1开始到n-1,然后看到(x + 1)^k是一个二项展开式,针对这个展开式构造一个包含C(n, m)的矩阵。 结果是两个矩阵相乘n-...
分类:其他   时间:2015-06-03 09:57:58    收藏:0  评论:0  赞:0  阅读:158
Summary Day28
1. 环境变量的使用 1.1 基本概念 环境变量一般是指操.作系统中用来指定操作系统运行环境和应用程序环境的一些变量 pash 就是一个环境变量,路劲 1.2 基本配置 (1)Windows 系统中的配置 (2)unix/linux 系统中的配置 echo 字符串 => 字符串原样输出,回显 echo $SHELL  =>  获取SHELL的值,进行回显 echo $PAT...
分类:其他   时间:2015-06-03 09:57:28    收藏:0  评论:0  赞:0  阅读:299
matlab histeq函数介绍
Histeq Enhance contrast using histogram equalization 该函数通过直方图均衡化来增加对比度 Syntax J = histeq(I,hgram) Description histeq enhances the contrast of images by transforming the values in an intensity im...
分类:其他   时间:2015-06-03 09:57:18    收藏:0  评论:0  赞:0  阅读:394
jmap命令使用
概述jmap是一个多功能的命令。它可以生成java程序的堆dump文件,也可以查看堆内对象实例的统计信息,查看ClassLoader的信息以及Finalizer队列。使用示例导出对象统计信息下面的命令生成PID为2500的java成粗的对象的统计信息,并输出到out.txt文件中:[qifuguang@winwill~]$ jmap -histo 2500 > out.txt [qifuguang@...
分类:其他   时间:2015-06-03 09:57:07    收藏:0  评论:0  赞:0  阅读:399
jhat命令使用
概述jhat(Java Head Analyse Tool)是jdk自带的用来分析java堆快照的工具,具体的使用方法是: jhat dump_file_name 使用示例在此以前文dump出来的文件(dump.bin)为例,演示怎么使用jhat分析堆文件。 上图中使用jhat命令打开了之前dump出来的堆快照文件,可以看到,命令成功执行后会在命令执行的本机启动一个http服务,可以在浏览...
分类:其他   时间:2015-06-03 09:56:53    收藏:0  评论:0  赞:0  阅读:248
poj 2480 Longge's problem 积性函数性质+欧拉函数
题意: 求f(n)=∑gcd(i, N) 1 分析: f(n)是积性的数论上有证明,且f(n)=sigma{1 代码: //poj 2480 //sep9 /* f(pi^ai) = Φ(pi^ai)+pi*Φ(pi^(ai-1))+pi^2*Φ(pi^(ai-2))+...+pi^(ai-1)* Φ(pi)+ pi^ai *Φ(1) = pi^(ai-1)*(pi-1) +...
分类:其他   时间:2015-06-03 09:51:49    收藏:0  评论:0  赞:0  阅读:481
05-图2. Saving James Bond - Easy Version (25)
1 边界和湖心小岛分别算一个节点,连接所有距离小于D的鳄鱼,时间复杂度O(N2) 2 判断每个连通图的节点中是否包含边界和湖心小岛,是则Yes否则No 3 冗长混乱的函数参数 #include #include #include #include using namespace std; struct Coordinate { float x; float...
分类:其他   时间:2015-06-03 09:50:08    收藏:0  评论:0  赞:0  阅读:841
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!