无向图求割点模板题 1 #include 2 #include 3 #include 4 using namespace std; 5 const int N=1002; 6 7 int subnets[N]; 8 int dfn[N],low[N]; 9 int count,mun,son...
分类:
其他好文 时间:
2014-08-08 15:24:46
阅读次数:
201
一道应用kmp算法中next数组的题目
这其中vis[i]从1加到n
vis[i]=[next[i]]+1;
#include
#include
#include
#include
#include
using namespace std;
char s[200005];
int b;
int next[200005];
int vis[200005];
void n...
分类:
其他好文 时间:
2014-08-08 09:42:11
阅读次数:
168
/*
KMP算法
*/
void main()
{
putsl(find('abc123','c1'))
putsl(find('abc123','c2'))
}
int find(rstr s,rstr p)
{
next=get_next(p)
i=0
j=0
for i<s.count&&j<p.count
if j==-1||s[i]==p[j]
i++
j...
分类:
其他好文 时间:
2014-08-08 02:00:55
阅读次数:
209
-- sql语句耗时百分比declare @tmptb table(id int,name varchar(50),total_worker_time bigint,rate varchar(50),execute_count bigint);with cte1 as(select a.*,t.*f...
分类:
数据库 时间:
2014-08-07 21:52:00
阅读次数:
351
题意:给你n(n#include #include #include #include #include #include using namespace std;#define N 207vector vx,vy;map hx,hy;int dx[4] = {0,0,1,-1};int dy[4]...
分类:
其他好文 时间:
2014-08-07 21:42:20
阅读次数:
260
mysql 中 FIND_IN_SET 是判断某个字符串是否在带逗号的字符串中
例如 SELECT
t.group_id,
COUNT(group_id) tsum
FROM (SELECT
group_id
FROM xx
WHERE FIND_IN_SET(openid,'qqqwqnfocFq5IL2sXB2Qu0I,oarwerrr...
分类:
数据库 时间:
2014-08-07 19:08:40
阅读次数:
268
转自:http://www.topthink.com/topic/2945.html 1 ";break; 14 }15 $count+=$flag; 16 } 17 }18 fclose($fp);19 //这里是你要执行的代码 ...
分类:
Web程序 时间:
2014-08-07 12:51:09
阅读次数:
217
<?php
header(‘Content-Type:text/html;charset=utf-8‘);
functioncutstr($str,$len){
if($len<0){returnnull;}
$chars=0;//字符数量
$offset=0;
$res=‘‘;
while($chars<$len){
$high=decbin(ord(substr($str,$offset,1)));
if(strlen($high)<8){
$count=1;
}els..
分类:
Web程序 时间:
2014-08-07 07:39:10
阅读次数:
265
1st round: 一个白人,先是聊了下project,然后一道coding题,找到距离一个节点k的所有节点。这个直接node bfs就可以解决。这一轮很基础。node bfs 加 count 计算level就行. facebook电面原题2nd round: 一个印度小伙,上来就是题,没有beh...
分类:
其他好文 时间:
2014-08-07 05:11:38
阅读次数:
302
题目:Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed fro....
分类:
编程语言 时间:
2014-08-07 03:02:58
阅读次数:
240