题目地址:POJ 3185
醉了。,。高斯消元这种题样例都不过的时候怎么调试好。。。干瞪着看了半天代码终于发现是一个符合写错了。。
这题同样是高斯消元+自由元枚举。没什么好说的。
代码如下:
#include
#include
#include
#include
#include
#include
#include
#include
#in...
分类:
其他好文 时间:
2015-01-27 18:27:11
阅读次数:
209
题目:The string "PAYPALISHIRING" is written
in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
P A H N
A P L S...
分类:
其他好文 时间:
2015-01-27 18:26:07
阅读次数:
184
Golang学习笔记,便于自己后续查看。
变量
变量是几乎所有编程语言中最基本的组成元素。从根本上说,变量相当于是对一块数据存储空间的命名,程序可以通过定义一个变量来申请一块数据存储空间,之后可以通过引用变量名来使用这块存储空间。
Go语言中的变量使用方式与C语言接近,但具备更大的灵活性。
变量声明
Go语言的变量声明方式与C和C++语言有明显的不同。对于纯粹的变量声明,G...
分类:
其他好文 时间:
2015-01-27 18:26:18
阅读次数:
182
昨天终于hadoop的项目验收完成了,终于可以松一口气了,总体还是比较满意的。
首先说一下项目流程,用mapreduce对数据进行预处理,然后用mahout中的聚类算法(kmeans)对数据进行处理,最后用peoplerank对数据进行处理。
根据老师交给我们的数据,包括Google+和Twitter的部分社交网络数据。以下是两个数据下载的链接
http://snap.stanford.ed...
分类:
其他好文 时间:
2015-01-27 18:24:46
阅读次数:
237
题目大意:给定一个m*n的矩阵,每个位置如果作为商业区或者工业区各有一个收益,如果相邻两块是不同的也会有一个收益,求最大收益
吐槽:住宅区呢- - 地理老师骗我们- -
普通的最小割建图会遇到一个问题:
割断两块之间的边收益为正,即代价为负
因此我们如果正常建最小割,那么两块之间的边权就会是负的
那么我们将这个矩阵黑白染色,将白格ST反向
这样割断两块之间的连边相当于两块选择了同一用途...
分类:
其他好文 时间:
2015-01-27 18:24:04
阅读次数:
218
【题目】
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where
the candidate numbers sums to T.
The same repeated number may be chosen from C unli...
分类:
其他好文 时间:
2015-01-27 18:23:32
阅读次数:
194
uva 10004 Bicoloring
In 1976 the ``Four Color Map Theorem" was proven with the assistance of acomputer. This theorem states that every map can be colored using only fourcolors, in such a way ...
分类:
其他好文 时间:
2015-01-27 18:25:17
阅读次数:
145
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
题目大意
给你个罗马数字,把它转换成一个int数。输入限定在[1, 3999]。
难度系数:容易
实现
一次性通过,:)
int getVal(c...
分类:
其他好文 时间:
2015-01-27 18:22:38
阅读次数:
160
解决分布式事务的最好办法就是不考虑分布式事务。
拆分,大的业务流程,转化成几个小的业务流程,然后考虑最终一致性。...
分类:
其他好文 时间:
2015-01-27 18:24:28
阅读次数:
180
转自:http://www.yihaomen.com/article/java/302.htm
(读者注:其实这个应该叫做很基础的入门一下下,如果你看过Hibernate了那这个就非常的简单)
(再加一条,其实大家可以看官方的教程更好些:http://mybatis.github.io/mybatis-3/,而且如果英文不是很好的那就看中文的:http://mybatis.github.io/...
分类:
其他好文 时间:
2015-01-27 18:24:53
阅读次数:
333
Write a function to find the longest common prefix string amongst an array of strings.
题目大意
写一个函数来找出所有字符串里最长的公共前缀。
难度系数:容易
实现
题目不难,基本思路大家都能想到,就是一些细节可能会遗漏。这个也没啥好算法,不管怎样,都需要一个个去比较。 所以没啥好说...
分类:
其他好文 时间:
2015-01-27 18:24:51
阅读次数:
103
??
同一个设备上的同一个APP多次绑定返回的user_id相同,channel_id也相同。
同一个APP在不同的设备上绑定user_id是不相同的,channel_id也不相同。
同一台设备对应唯一一个channel_id。(多个APP共用一条通道),所以在同一台设备上的多个APP绑定时,它们的channel_id是相同的。
同一台设...
分类:
其他好文 时间:
2015-01-27 18:22:24
阅读次数:
165
=====================
template
class any
{
public:
T m_data;
};
void main()
{
any a;
}
缺点是 必须知道类型,有时我们并不知道某个对象的类型。
-------------
class any
{
public:
template
any...
分类:
其他好文 时间:
2015-01-27 18:21:59
阅读次数:
177
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a p...
分类:
其他好文 时间:
2015-01-27 18:23:55
阅读次数:
182
这题目有点大,有点吓人,为什么这么说呢,请听我讲。
很多土豪用iphone,我还用小米,之所以用小米,还不是看小米性价比还过得去嘛,另外,我偶尔用小米跑跑安卓程序。小米别的地方都还好,但有个地方总是不爽,屏幕偶尔无响应,我在论坛也看过,很多人碰到跟我一样的问题,这个问题显然是个软件问题,因为只要锁屏再开马上就好了,有时出现这个问题的时候backup按键也有效,其他触摸等基本无反应,或者反应非常迟...
分类:
其他好文 时间:
2015-01-27 18:21:48
阅读次数:
131
【题目】
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where
the candidate numbers sums to T.
Each number in C may only be used once in t...
分类:
其他好文 时间:
2015-01-27 18:21:00
阅读次数:
180
Given an index k, return the kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note: Could you optimize your algorithm to use only O(k) extra space?
题目大意
给定一个索引k,...
分类:
其他好文 时间:
2015-01-27 18:21:38
阅读次数:
172