题目 :http://acm.bnu.edu.cn/v3/problem_show.php?pid=40489最近做到的一道蛮有意思的题目(codechef现在的题目确实很赞了)题意 :中文题面 (cc的一大好处就是有中文翻译,嘿嘿)区间Max = max{a_i|gcd(a_i, g) > 1 &...
分类:
其他好文 时间:
2014-10-16 23:35:33
阅读次数:
307
条件表达式形式:condition, then and else ...混合使用表达式实例: ...其他表达式也可以省略,在这种情况下,返回一个null值如果条件是错误的 ...
分类:
其他好文 时间:
2014-10-16 21:00:13
阅读次数:
304
Oracle “CONNECT BY”是层次查询子句,一般用于树状或者层次结果集的查询。其语法是:[ START WITH condition ]CONNECT BY [ NOCYCLE ] condition说明: 1. START WITH:告诉系统以哪个节点作为根结点开始查找并构造结果集,该....
分类:
数据库 时间:
2014-10-16 19:28:23
阅读次数:
266
#!/usr/bin/env python#coding=utf-8import threadingimport urllibimport reimport timecur=0last=0totalcount=0depth=0t_mutex=threading.Condition() class M...
分类:
编程语言 时间:
2014-10-15 00:21:09
阅读次数:
297
线程池的封装,基础思想与生产者消费者的封装一样,只不过我们是将线程池封装为自动获取任务、执行任务,让用户调用相应的接口来添加任务。在线程池的封装中,我们同样需要用到的是MutexLock、Condition、Thread这些基本的封装。基础封装如下:MutexLock: 1 #ifndef MUTE...
分类:
编程语言 时间:
2014-10-14 14:17:39
阅读次数:
328
在看《Cplusplus Concurrency in Action Practical Multithreading》。记录一下学习过程,这是第三章开始部分,谈什么事资源竞争(race condition)以及有哪些方法来避免。...
分类:
其他好文 时间:
2014-10-13 14:00:09
阅读次数:
184
java线程 使用显示的lock 和condition...
分类:
编程语言 时间:
2014-10-12 14:58:58
阅读次数:
151
题目大意:给出一棵树,问有没有两点之间的距离是k的。多组数据
思路:和IOI2011的Race一样,比那个简单。读入太恶心了,我是上网上抄的别人的主函数。
CODE:
#include
#include
#include
#include
#define MAX 200010
#define INF 0x3f3f3f3f
using namespace std...
分类:
其他好文 时间:
2014-10-12 14:22:28
阅读次数:
463
Disky and Sooma, two of the biggest mega minds of Bangladesh went to a far country. They ate, coded and wandered around, even in their holidays. They passed several months in this way. But everything ...
分类:
其他好文 时间:
2014-10-12 02:44:17
阅读次数:
316
CF:Carry Flag.The most recent operation generated a carry out of the most significant bit.Used to detect overflow for unsigned operations.ZF:Zero Flag...
分类:
其他好文 时间:
2014-10-11 11:28:15
阅读次数:
158