weber-xie
码龄13年
关注
提问 私信
  • 博客:73,871
    社区:229
    74,100
    总访问量
  • 50
    原创
  • 1,014,567
    排名
  • 9
    粉丝
  • 0
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:北京市
  • 加入CSDN时间: 2011-11-06
博客简介:

WeberXie

博客描述:
勤思,慎勉
查看详细资料
个人成就
  • 获得11次点赞
  • 内容获得4次评论
  • 获得24次收藏
创作历程
  • 20篇
    2014年
  • 33篇
    2013年
  • 2篇
    2012年
成就勋章
TA的专栏
  • ----------学习笔记---------
  • DP
    7篇
  • 算法
    27篇
  • linux
    6篇
  • lua
    1篇
  • ACM题库
    14篇
  • 学习感悟
  • JAVA基础
    3篇
  • JAVAEE基础
    1篇
  • python
    1篇
  • ----------随笔文章---------
  • 求职面试
    3篇
  • linux程序设计
    1篇
  • leetcode
    7篇
创作活动更多

超级创作者激励计划

万元现金补贴,高额收益分成,专属VIP内容创作者流量扶持,等你加入!

去参加
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

Divide Two Integers

用减法可能会超时,但可以用二分class Solution {public:    int divide(int d1, int d2) {//       d1/d2        if(d1==0)            return 0;        if(d2==1)            return d1;        if(d2==-1)   
原创
发布博客 2014.06.03 ·
1135 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode Reverse Nodes in k-Group

递归一下/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: Li
原创
发布博客 2014.06.01 ·
1131 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode Remove Nth Node From End of List

题目说:Try to do this in one pass只用一遍遍历的话,p1先走n节点,p2再走,等到p1到达链表尾的时候p2正好在倒数第n+1个上面鸟/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode
原创
发布博客 2014.05.22 ·
948 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode 3Sum 3Sum Closest 4Sum

这几个题很典型也是国外一些知名公司经常会问到的题3Sum:排序,避免重复,时间复杂度O(n^2)class Solution {public: vector > threeSum(vector &num) { int len=num.size(); sort(num.begin(),num.begin()+len);
原创
发布博客 2014.05.21 ·
909 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode Longest Common Prefix

找出单词的最长公共前缀class Solution {public: string longestCommonPrefix(vector &strs) { int len=strs.size(); if(len==0) return ""; int length=strs[0].size(),j;
原创
发布博客 2014.05.19 ·
1047 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

日志结构的合并树 The Log-Structured Merge-Tree

日志结构的合并树 The Log-Structured Merge-Tree近年来,随着互联网数据的日益增长,管理分布式数据需求的日益增加,Bigtable[1]等一系列NoSQL数据库开始涌现。Bigtable是一个分布式的结构化数据存储系统,它被设计用来处理海量数据,其在提供Tablet服务时使用内存中的memtable和GFS[2]中的SSTable来相互配合着来存储数据
转载
发布博客 2014.05.18 ·
1123 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode Integer to Roman

把阿拉伯数字转换成罗马数字
原创
发布博客 2014.05.15 ·
821 阅读 ·
1 点赞 ·
0 评论 ·
0 收藏

poj 2431 Expedition 贪心+最大堆

当油量不够时从走过的油站中选最大加油量的#include#include#include#includeusing namespace std;#define MAX_N 10005struct node{ int dist,fuel;}t[MAX_N];bool cmp(const node &a,const node &b){ return a.dist<b.dis
原创
发布博客 2014.04.27 ·
993 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

poj 1664 放苹果

动态规划解DP问题考虑n的m划分a1+...am=n对于每个ai都有ai>0,那么{ai-1}就对应了n-m的m划分,如果存在ai=0那么就对应了n的m-1划分。综上可得出如下递推关系dp[i][j]=dp[i][j-i]+dp[i-1][j]#include#include#includeusing namespace std;int dp[12][12];int main
原创
发布博客 2014.04.18 ·
917 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

poj 1742 Coins

动态规划,多重部分和问题,,数组得要重复利用,不然会MLE。。#include#include#includeusing namespace std;int dp[100000+2];int a[100+2];int c[100+2];int main(){ int n,m; while(scanf("%d %d",&n,&m)&&(n+m)!=0) { for(in
原创
发布博客 2014.04.18 ·
977 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

poj Common Subsequence 最长公共子序列

真的很水,,原谅我吧#include#include#include#includeusing namespace std;const int N=1002;int dp[N][N];char a[N],b[N];int main(){ while(scanf("%s %s",a,b)!=EOF) { int n=strlen(a); int m=strlen(b
原创
发布博客 2014.04.17 ·
849 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

poj 3624 Charm Bracelet

标准的01背包#include#includeusing namespace std;#define MAX_N 3405int w[MAX_N],d[MAX_N];int dp[12881];int main(){ int n,m; cin>>n>>m; memset(dp,0,sizeof(dp)); for(int i=0;i<n;i++) cin>>w[i]>
原创
发布博客 2014.04.17 ·
883 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

poj 3253 Fence Repair

类似Huffman编码,越短的板在二叉树中深度越大如排序后的序列:L1、L2、L3、L4、L5....LN(L1+L2)为最短的两个之后,插入L3、L4、L5....LN中重复上述步骤直至只剩一块板为止#include#include#includeusing namespace std;#define MAX_N 20002typedef long long ll;i
原创
发布博客 2014.04.17 ·
968 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

poj 3069Saruman's Army 贪心

#include#include#includeusing namespace std;#define MAX_N 1002int x[MAX_N];int r,n;int main(){ while(cin>>r>>n && r+n != -2) { for(int i=0;i<n;i++) cin>>x[i]; sort(x,x+n); int i=0,a
原创
发布博客 2014.04.16 ·
966 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

应届生如何写好简历

昨天写了些应届毕业生简历的常见问题,很多人觉得我太苛刻,觉得对应届生要求有点高;有的觉得看了后还是不会写。那么今天我们就来看看怎么才能做好。需要声明的是我帮不了太多人,只有那些对计算机科学真的有点兴趣的人可能觉得我说的有点用。这里写的东西仅仅是我们的观点,不代表别的公司也这么做或者应该这么做。* 没有必要撒谎写简历最差的策略就是撒谎了。这种欺骗本身就自相矛盾。你到底希望
转载
发布博客 2014.04.09 ·
1513 阅读 ·
2 点赞 ·
0 评论 ·
8 收藏

zoj2136 最长上升子序列LIS O(NlgN)解法

题目链接:zoj2136讲当前最长上升子序列建一个数组,利用二分查找#includeusing namespace std;const int maxn = 1002;int a[maxn];int find(int *a,int len,int n){ int left = 0,right=len,mid=(left+right)/2; while(left<=rig
原创
发布博客 2014.04.03 ·
1181 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Linux下/proc目录简介

1. /proc目录Linux 内核提供了一种通过 /proc 文件系统,在运行时访问内核内部数据结构、改变内核设置的机制。proc文件系统是一个伪文件系统,它只存在内存当中,而不占用外存空间。它以文件系统的方式为访问系统内核数据的操作提供接口。用户和应用程序可以通过proc得到系统的信息,并可以改变内核的某些参数。由于系统的信息,如进程,是动态改变的,所以用户或应用程序读取proc文
转载
发布博客 2014.04.02 ·
850 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

KMP算法

int KMPMatch(char *s,char *p){ int next[100]; int i,j; i=0; j=0; getNext(p,next); while(i<strlen(s)) { if(j==-1||s[i]==p[j]) { i++;
原创
发布博客 2014.03.06 ·
814 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode Question Difficulty Distribution

转自:LeetCode Question Difficulty Distribution : Sheet1       IDQuestionDiffFreqData StructureAlgorithms  
原创
发布博客 2014.03.05 ·
1288 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

linux grep命令

转自:http://www.cnblogs.com/end/archive/2012/02/21/2360965.html1.作用Linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来。grep全称是Global Regular Expression Print,表示全局正则表达式版本,它的使用权限是所有用户。2.格式gre
原创
发布博客 2014.02.24 ·
900 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏
加载更多