只设置文件夹权限为755 文件权限为644find -type d -exec chmod 755 {} \;find -type f -exec chmod 644 {} \;或者find -type d|xargs chmod 755find -type f|xargs chmod 644
分类:
系统相关 时间:
2014-07-01 22:35:28
阅读次数:
235
之前做了《Sublime Text 2 绿色汉化版 x64》,这些天抽空做了下 ST3 的汉化。。果然我没有任何理由爱上 ST3,不仅pojie麻烦,而且汉化更麻烦,菜单字符长度做了限制。比如 搜索 处的 Find 只能写4个字符,而汉字 搜索 的 utf-8 是E6 90 9C E7 B4 A2 ...
分类:
其他好文 时间:
2014-07-01 22:13:11
阅读次数:
390
First Missing Positive:Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] retu...
分类:
其他好文 时间:
2014-07-01 13:13:59
阅读次数:
218
题目:
链接:点击打开链接
题意:
思路:
对dijkstra稍作修改即可,每次更新dis[]时改为乘积。
代码:
#include
#include
#include
using namespace std;
#define INF 100000000
const int N = 1010;
int n,m;
double map[N][N]...
分类:
其他好文 时间:
2014-07-01 10:53:50
阅读次数:
180
本题也是个标准的并查集题解。
操作完并查集之后,就是要找和0节点在同一个集合的元素有多少。
注意这个操作,需要先找到0的父母节点,然后查找有多少个节点的额父母节点和0的父母节点相同。
这个时候需要对每个节点使用find parent操作,因为最后状态的时候,节点的parent不一定是本集合的根节点。
#include
const int MAX_N = 30001;
stru...
分类:
其他好文 时间:
2014-07-01 10:50:15
阅读次数:
179
Given a string containing just the characters '(' and ')',
find the
length of the longest valid (well-formed) parentheses substring.For "(()",
the
longest valid parentheses substring is "()...
分类:
其他好文 时间:
2014-07-01 09:09:06
阅读次数:
156
本题是标准的并查集了,最后利用这些集求有多少独立集。
所以这里也写个标准程序过了。
最后查找独立集合: 看有多少个节点的父母节点是自己的,那么就是独立集合了。自己做自己的父母当然最独立的了,没有任何依赖,呵呵。
#include
const int MAX_N = 50001;
//const int MAX_M = MAX_N/2 * (MAX_N-1) + 1;
int N, M;
...
分类:
其他好文 时间:
2014-07-01 07:46:53
阅读次数:
160
题目
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it witho...
分类:
其他好文 时间:
2014-06-30 19:38:37
阅读次数:
226
题目
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it...
分类:
其他好文 时间:
2014-06-30 19:23:18
阅读次数:
200
题目
Given n points
on a 2D plane, find the maximum number of points that lie on the same straight line.
方法
每次选择一个点,和其他n - 1个点,进行判断,统计最多的。
double computeSlope(Point a, Point b) {
...
分类:
其他好文 时间:
2014-06-30 15:48:45
阅读次数:
184