7 lilong_dream

尚未进行身份认证

Work hard. Have fun. Make history.

等级
TA的排名 1w+

KMP算法

KMP算法的介绍参见维基百科:https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm这篇文章的解释不错:http://www.ruanyifeng.com/blog/2013/05/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm.html

2017-03-09 00:36:49

git常用操作

git缩写配置:在.gitconfig文件中添加:[alias]  br=branch  co=checkout  ci=commit  st=status  last=log-1HEADgit常用操作:gitclone克隆一个分支gitbr查看分支,-a参数可列出所有分支gitco-b

2017-02-28 23:44:58

awk sed等常用命令

选取奇数行catfile|awkNR%2==1以":"分隔,打印第二列catfile|awk-F:'{print$2}'以":"分隔,按第二列排序catfile|sort-t':'-k2以":,"分隔,选取第二列和第4列相同的catfile|awk-F'[:,]''$2==$4'

2015-07-05 17:49:31

LeetCode 160 — Intersection of Two Linked Lists(C++ Python)

题目:https://oj.leetcode.com/problems/intersection-of-two-linked-lists/Writeaprogramtofindthenodeatwhichtheintersectionoftwosinglylinkedlistsbegins.Forexample,thefollowingtwo

2014-12-02 20:59:16

hihoCoder1051 - 补提交卡

代码:#include#includeintmain(){ intT; std::cin>>T; intN,M; for(inti=0;i<T;++i) { std::cin>>N>>M; std::vectornums(N+1,0); for(intj=0;j<N;++j) { std

2014-09-29 20:34:40

HDOJ1039 - Easier Done Than Said?

题目:EasierDoneThanSaid?

2014-09-29 15:57:05

CodeChef - Small factorials

题目:Youareaskedtocalculatefactorialsofsomesmallpositiveintegers.InputAnintegert,1OutputForeachintegerngivenatinput,displayalinewiththevalueofn!ExampleSamp

2014-09-29 15:25:22

hihoCoder1039 - 字符消除

描述小Hi最近在玩一个字符消除游戏。给定一个只包含大写字母"ABC"的字符串s,消除过程是如下进行的:1)如果s包含长度超过1的由相同字母组成的子串,那么这些子串会被同时消除,余下的子串拼成新的字符串。例如"ABCCBCCCAA"中"CC","CCC"和"AA"会被同时消除,余下"AB"和"B"拼成新的字符串"ABB"。2)上述消除会反复一轮一轮进行,直到新的字符串不包含相邻的

2014-09-29 14:27:16

HackerRank - Stock Maximize

#include#includeintmain(){intT;std::cin>>T;intN;while(T--){std::cin>>N;std::vectornums(N,0);for(inti=0;i<N;++i)

2014-09-27 20:31:16

ZOJ Monthly - 135 A + G

A 题目:AbsProblemTimeLimit: 2Seconds     MemoryLimit: 65536KB     SpecialJudgeAliceandBobisplayingagame,andthistimethegameisallabouttheabsolutevalue!Alice

2014-08-24 18:31:17

LightOJ1337 - The Crystal Maze

题目:http://lightoj.com/volume_showproblem.php?problem=1337Youareinaplaneandyouareabouttobedroppedwithaparasuitinacrystalmaze.Asthenamesuggests,themazeisfullofcrystals.Y

2014-08-01 22:38:46

POJ1979 - Red and Black

题目:http://poj.org/problem?id=1979

2014-08-01 22:07:20

Codeforces - 327A - Flipping Game

题目:http://codeforces.com/problemset/problem/327/A

2014-08-01 21:23:55

Codeforces - 219A - k-String

题目:http://codeforces.com/problemset/problem/219/A

2014-08-01 20:56:34

LeetCode 97 — Interleaving String (C++ Python)

题目:https://oj.leetcode.com/problems/interleaving-string/Given s1, s2, s3,findwhether s3 isformedbytheinterleavingof s1 and s2.Forexample,Given:s1 = "aabcc",s2 = "dbbca",Whe

2014-07-31 22:44:18

LeetCode 72 — Edit Distance(C++ Python)

题目:https://oj.leetcode.com/problems/edit-distance/

2014-07-31 22:24:13

面试常备程序 — 字符串篇

1strcmpintstrcmp(constchar*s1,constchar*s2){while(*s1&&(*s1==*s2))s1++,s2++;return*(constunsignedchar*)s1-*(constunsignedchar*)s2;}

2014-05-09 15:59:39

九度剑指Offer面试题10:二进制中1的个数(Java题解)

面试题10二进制中1的个数

2014-04-22 19:06:08

九度剑指Offer面试题9:斐波那契数列(Java题解)

importjava.util.Scanner;publicclassMain{ publicstaticvoidmain(Stringargs[]){ long[]fibo=newlong[71]; fibo[0]=0; fibo[1]=1; for(inti=2;i<=70;++i){ fibo[i]=

2014-04-22 18:47:54

LeetCode 22 — Generate Parentheses(C++ Java Python)

题目:http://oj.leetcode.com/problems/generate-parentheses/Given n pairsofparentheses,writeafunctiontogenerateallcombinationsofwell-formedparentheses.Forexample,given n =3,asolut

2014-04-17 11:11:41

查看更多

勋章 我的勋章
    暂无奖章