原题: URAL 1091 http://acm.timus.ru/problem.aspx?space=1&num=1091题意:要求找出K个不同的数字使他们有一个大于1的公约数,且所有的数字都不能大于一个指定的数字S。解法:可以考虑每个S内的素数,此素数和它的所有倍数构成一个集合,则可以在这些集...
分类:
其他好文 时间:
2014-07-02 00:37:32
阅读次数:
253
Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.For exampl...
分类:
其他好文 时间:
2014-07-01 23:43:03
阅读次数:
293
Error info:java.lang.OutOfMemoryError: PermGen space at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLo...
分类:
编程语言 时间:
2014-07-01 22:57:18
阅读次数:
319
vim中将tab自动转换成空格在vim中,有时需要将tab转换成space。使用ret命令(replace tab)。[range]ret[ab]! [new-tabstop]举例:将第一行到文件尾的tab转换成space,每个tab用4个space替代。:set expandtab:%ret! 4...
分类:
其他好文 时间:
2014-07-01 20:23:15
阅读次数:
458
今天做了一个如下图的模块其中,标题以及介绍这两块都需要做超出某个宽度就截取一行或两行文字,后面用省略号代替。由于是做的手机页面,用JS来开销太大,只能从CSS入手。一行的很好解决。如下就OK了。white-space:nowrap;overflow:hidden;text-overflow:elli...
分类:
其他好文 时间:
2014-07-01 13:12:09
阅读次数:
171
如果是KDM、GDM、LightDM,打开~/.xprofile。如果是startx、Slim,打开~/.xinitrc。(没有就新建一个)export GTK_IM_MODULE=fcitxexport QT_IM_MODULE=fcitxexport XMODIFIERS="@im=fcitx"...
分类:
其他好文 时间:
2014-07-01 12:59:02
阅读次数:
586
Sorted Array:Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is gre...
分类:
其他好文 时间:
2014-07-01 12:51:53
阅读次数:
202
题目
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Follow up:
Can you solve it without using extra space?
方法
public ListNode de...
分类:
其他好文 时间:
2014-07-01 11:30:58
阅读次数:
200
Weekly golfers will find a bag that gives them enough space to do a lot of tees, balls, sticks, and whatever he deems necessary for the golf course. P...
分类:
其他好文 时间:
2014-06-30 20:52:39
阅读次数:
258
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with...
分类:
其他好文 时间:
2014-06-30 17:22:13
阅读次数:
196