参考:https://discuss.leetcode.com/topic/49238/math-solution-java-solution The basic idea is to use the property of Bézout's identity and check if z is a ...
分类:
其他好文 时间:
2016-11-27 07:45:30
阅读次数:
185
Either pthread_join(3) or pthread_detach() should be called for each thread,that an application creates, so that system resources for the thread can b ...
分类:
编程语言 时间:
2016-11-26 22:48:35
阅读次数:
206
转自https://discuss.leetcode.com/topic/49771/java-simple-easy-understand-solution-with-explanation/2,注意里面对于减法的讲解 have been confused about bit manipulati ...
分类:
其他好文 时间:
2016-11-26 14:03:23
阅读次数:
173
Menus and toolbars A common part in a GUI application is a menubar. A menubar consists of objects called menus. Top-level menus have their labels on t ...
分类:
编程语言 时间:
2016-11-26 13:41:44
阅读次数:
646
这题参照http://blog.jobbole.com/42550/ 用的蓄水池算法,即更改ans的概率为1/(当前length) ...
分类:
其他好文 时间:
2016-11-25 11:30:29
阅读次数:
157
https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/ ...
分类:
其他好文 时间:
2016-11-21 22:45:25
阅读次数:
194
I called him in when dinner was ready, and he sniffed appreciatively as he walked into the room. 当晚饭准备好的时候我叫他吃饭,然后当他进入房间的时候他吸气般的表示感激。 "Smells good, Be ...
分类:
其他好文 时间:
2016-11-21 07:48:33
阅读次数:
171
背景 对于某一个函数, 其被调用多次, 每次调用的入参都是一致的。 不想每次都填写参数, 如果能够定义一个新的函数, 将参数跟此函数绑定就棒哒哒了。 类似javascript function.bind功能: https://developer.mozilla.org/en-US/docs/Web/ ...
分类:
其他好文 时间:
2016-11-19 02:47:14
阅读次数:
202
新看看官方demo的libevent如何使用信号int called = 0;static voidsignal_cb(int fd, short event, void *arg){ struct event *signal = arg; printf("%s: got signal %d\n",... ...
分类:
其他好文 时间:
2016-11-17 13:30:54
阅读次数:
370