关闭

[置顶] LeetCode题解汇总(C++ Java Python,含题目翻译)

LeetCode题目(含AC Rates):http://oj.leetcode.com/problems/ 我的github:https://github.com/lilong-dream/ 1 Two Sum http://blog.csdn.net/lilong_dream/article/details/19298357 2 Median of Two Sorted Arrays...
阅读(34017) 评论(0)

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...
阅读(176) 评论(0)

git常用操作

git缩写配置: 在.gitconfig文件中添加: [alias]     br = branch     co = checkout     ci = commit     st = status     last = log -1 HEAD git常用操作: git clone 克隆一个分支 git br 查看分支,-a参数可列出所有分支 git co -b...
阅读(261) 评论(0)

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'...
阅读(401) 评论(0)

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...
阅读(1715) 评论(0)

hihoCoder1051 - 补提交卡

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

HDOJ1039 - Easier Done Than Said?

题目: Easier Done Than Said?...
阅读(543) 评论(0)

CodeChef - Small factorials

题目: You are asked to calculate factorials of some small positive integers. Input An integer t, 1 Output For each integer n given at input, display a line with the value of n! Example Samp...
阅读(484) 评论(0)

hihoCoder1039 - 字符消除

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

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)...
阅读(1276) 评论(0)

ZOJ Monthly - 135 A + G

A  题目: Abs Problem Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge Alice and Bob is playing a game, and this time the game is all about the absolute value! Alice ...
阅读(595) 评论(0)

LightOJ1337 - The Crystal Maze

题目:http://lightoj.com/volume_showproblem.php?problem=1337 You 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...
阅读(760) 评论(0)

POJ1979 - Red and Black

题目:http://poj.org/problem?id=1979...
阅读(563) 评论(0)

Codeforces - 327A - Flipping Game

题目:http://codeforces.com/problemset/problem/327/A...
阅读(1849) 评论(0)

Codeforces - 219A - k-String

题目: http://codeforces.com/problemset/problem/219/A...
阅读(734) 评论(0)

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...
阅读(1216) 评论(0)
80条 共6页1 2 3 4 5 ... 下一页 尾页
    个人资料
    • 访问:250901次
    • 积分:3040
    • 等级:
    • 排名:第12652名
    • 原创:75篇
    • 转载:2篇
    • 译文:3篇
    • 评论:33条
    欢迎访问我的博客
    文章分类
    最新评论