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 -1 HEADgit常用操作:git clone 克隆一个分支git br 查看分支,-a参数可列出所有分支git co -b

2017-02-28 23:44:58

awk sed等常用命令

选取奇数行cat file |awk NR%2==1以":"分隔,打印第二列cat file |awk -F: '{print $2}'以":"分隔,按第二列排序cat file |sort -t ':' -k 2以":,"分隔,选取第二列和第4列相同的cat file |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/Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two

2014-12-02 20:59:16

hihoCoder1051 - 补提交卡

代码:#include #include int main(){ int T; std::cin >> T; int N, M; for(int i = 0; i < T; ++i) { std::cin >> N >> M; std::vector nums(N + 1, 0); for(int j = 0; j < N; ++j) { std

2014-09-29 20:34:40

HDOJ1039 - Easier Done Than Said?

题目:Easier Done Than Said?

2014-09-29 15:57:05

CodeChef - Small factorials

题目:You are asked to calculate factorials of some small positive integers.InputAn integer t, 1OutputFor each integer n given at input, display a line with the value of n!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 #include int main() { int T; std::cin >> T; int N; while(T--) { std::cin >> N; std::vector nums(N, 0); for(int i = 0; i < N; ++i)

2014-09-27 20:31:16

ZOJ Monthly - 135 A + G

A 题目:Abs ProblemTime Limit: 2 Seconds      Memory Limit: 65536 KB      Special JudgeAlice and Bob is playing a game, and this time the game is all about the absolute value!Alice

2014-08-24 18:31:17

LightOJ1337 - The Crystal Maze

题目:http://lightoj.com/volume_showproblem.php?problem=1337You are in a plane and you are about to be dropped with a parasuit in a crystal maze. As the name suggests, the maze is full of crystals. 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, find whether s3 is formed by the interleaving of s1 and s2.For example,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

面试常备程序 — 字符串篇

1 strcmpint strcmp(const char* s1, const char* s2){ while(*s1 && (*s1==*s2)) s1++,s2++; return *(const unsigned char*)s1-*(const unsigned char*)s2;}

2014-05-09 15:59:39

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

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

2014-04-22 19:06:08

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

import java.util.Scanner;public class Main { public static void main(String args[]) { long[] fibo = new long[71]; fibo[0] = 0; fibo[1] = 1; for (int i = 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 pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solut

2014-04-17 11:11:41

查看更多

勋章 我的勋章
    暂无奖章