并查集 简单题 1 #include 2 #include 3 #include 4 #define N 10000005 5 using namespace std; 6 int par[N]; 7 int M[N]; 8 int Find(int x) 9 {10 if(par[x...
分类:
其他好文 时间:
2014-07-23 11:57:36
阅读次数:
182
题目:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should ...
分类:
编程语言 时间:
2014-07-23 11:49:36
阅读次数:
357
find the most comfortable roadProblem DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed...
分类:
其他好文 时间:
2014-07-23 11:35:26
阅读次数:
227
题目
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 wit...
分类:
其他好文 时间:
2014-07-23 00:13:17
阅读次数:
331
AppiumDriver
getAppStrings()
默认系统语言对应的Strings.xml文件内的数据。
driver.getAppStrings(String language)
查找某一个语言环境对应的字符串文件Strings.xml内数据
sendKeyEvent(int key)
按下某个键,具体哪个键由key值决定,ke...
分类:
移动开发 时间:
2014-07-23 00:08:57
阅读次数:
263
题意:就是要你求最小生成树所需的最小距离
思路:Kruskal算法
AC代码:
#include
#include
#include
using namespace std;
#define N 125000
int u[N],v[N],w[N],r[N];
int f[520],str[520][520];
int find(int x)
{
if(x!=f[x])
...
分类:
Web程序 时间:
2014-07-23 00:03:57
阅读次数:
266
#include #include void main(){ int x,i; char str[100]; //gets(st1); printf("Please input a string to find out whether the string is palind...
分类:
其他好文 时间:
2014-07-22 23:04:32
阅读次数:
240
题目一:Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, ...
分类:
其他好文 时间:
2014-07-22 23:04:12
阅读次数:
246
public class Priority_Queue {
//储存的数组
private int A[];
//堆的大小
private int pile_Size=0;
//如果找到指定值,返回 -1
private int NOT_FIND = -1;
//堆容器的大小增量
private int INCREAT_CAPCITY=20;
//堆容器大小
privat...
分类:
其他好文 时间:
2014-07-22 18:06:02
阅读次数:
306
最近在tornado\mongodb\ansible
mongodb中有个find()方法很牛逼,可以将集合中所有的表都传出来,一开始我这么写
class Module_actionHandler(tornado.web.RequestHandler):
def get(self, *args, **kwargs):
coll = self.applic...
分类:
数据库 时间:
2014-07-22 17:52:41
阅读次数:
291