上一页 1 2 3 4 5 6 7 8 9 ··· 37 下一页

2015年1月14日

位操作(求[a, b] 中二进制位为1的个数最多的数)

摘要: 传送门题意:求区间[a, b]中二进制位为1的个数最多的那个数,如果存在多解,则输出最小的那个。(0 2 3 typedef long long ll; 4 5 int main(void) { 6 int n; 7 scanf("%d", &n); 8 while (... 阅读全文

posted @ 2015-01-14 15:14 Stomach_ache 阅读(234) 评论(0) 推荐(0) 编辑

2014年12月29日

Java操作Mysql笔记

摘要: 第一步,需要下载JDBC驱动, 点我。然后选择合适的版本即可。下载完成之后解压,然后将mysql-connector-java-5.1.6-bin.jar文件放到java的安装目录下面。这里每个人的安装路径不同,需要找到自己的路径。第二步,需要在mysql下新建一个数据库,这个很简单,比如creat... 阅读全文

posted @ 2014-12-29 19:23 Stomach_ache 阅读(202) 评论(0) 推荐(0) 编辑

2014年12月20日

LRU Cache -- LeetCode

摘要: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu... 阅读全文

posted @ 2014-12-20 14:11 Stomach_ache 阅读(317) 评论(0) 推荐(0) 编辑

2014年12月13日

TF-IDF了解

摘要: http://en.wikipedia.org/wiki/Tf%E2%80%93idf 阅读全文

posted @ 2014-12-13 14:04 Stomach_ache 阅读(101) 评论(0) 推荐(0) 编辑

Linux 命令之head, tail, tr, sort, uniq, grep

摘要: head [filename]head -n 11 [filename] -> First 11 lines head -c 20 [filename] -> First 20 characters head默认为显示前10行。tail [filename]tail -n 11 [filena... 阅读全文

posted @ 2014-12-13 12:43 Stomach_ache 阅读(413) 评论(0) 推荐(0) 编辑

2014年12月4日

Linux命令之cut

摘要: 今天看了一些关于cut命令的简单使用方法。cut一般不是单独使用,比如我要查看bash的版本信息,可以使用 :bash --version | head -n1 | cur -d ' ' -f 2-4cut 命令有几个选项,-c表示字符(一个汉字也算是一个字符)。比如我有一个文件a.txt,我想现实... 阅读全文

posted @ 2014-12-04 12:15 Stomach_ache 阅读(170) 评论(0) 推荐(0) 编辑

2014年12月1日

树上某点距离最远的结点

摘要: 题目链接题目需要得到树上每个结点出发可到达的最远的结点,顺便求出树的直径。这里顺便总结一下求解的两种方法。第一种思路:三种dfs(bfs) 第一遍dfs(bfs)从任意结点出发,找到距离该结点最远的结点u(直径的端点之一)。 第二遍dfs(bfs)从u出发,求出其他点到u的距离,最长的即为v(直... 阅读全文

posted @ 2014-12-01 20:24 Stomach_ache 阅读(758) 评论(0) 推荐(0) 编辑

2014年11月30日

ssh小知识

摘要: 1、查看系统在线用户[root@testdb ~]# w14:30:26 up 38 days, 21:22, 3 users, load average: 0.00, 0.01, 0.05USER TTY FROM LOGIN@ IDLE JCPU PCPU WHATroot pts/0 162.... 阅读全文

posted @ 2014-11-30 23:54 Stomach_ache 阅读(158) 评论(0) 推荐(0) 编辑

2014年11月16日

101 Hack October'14

摘要: 拖了近一个月的总结。(可能源于最近不太想做事:()A题给出n个长度都为n的字符串,你只可以对每个字符串分别排序,问当每个字符串按升序排序之后,每一列是否也是升序的。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using... 阅读全文

posted @ 2014-11-16 20:41 Stomach_ache 阅读(197) 评论(0) 推荐(0) 编辑

2014年11月15日

vim中利用swp文件进行恢复

摘要: 经常电脑因为没电或者强行关闭vim,会导致原文件没有保存,这种情况下vim会自动保存一个.swp文件,需要恢复时,使用vim -r filename期中-r意思为recovery恢复之后最好删除.swp文件,否则会一直提示一些恼人的信息。rm .*swp即可。 阅读全文

posted @ 2014-11-15 14:51 Stomach_ache 阅读(1621) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 37 下一页

导航