摘要: InputThe first line of input will contain an integer that will determine the number of test cases. Each casestarts with an integer n (n ≤ 10), that rep 阅读全文
posted @ 2017-09-23 23:50 少年啦飞驰 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Recently your team noticed that the computer you use to practice for programming contests is not good enough anymore. Therefore, you decide to bu 阅读全文
posted @ 2017-09-23 16:21 少年啦飞驰 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Input The input le contains at most 100 test cases. Each test case starts with a positive integer N (1 ≤N ≤ 60), which means the number of disks. You 阅读全文
posted @ 2017-09-19 00:30 少年啦飞驰 阅读(122) 评论(0) 推荐(0) 编辑
摘要: InputInput consists of several lines each with N such that 1 ≤ N ≤ 1, 000, 000, 000. Input will be terminatedby end of file.OutputFor each N output L i 阅读全文
posted @ 2017-09-16 09:44 少年啦飞驰 阅读(109) 评论(0) 推荐(0) 编辑
摘要: link Input The input consists of at most 50 test cases. Each case consists of 13 tiles in a single line. The hand islegal (e.g. no invalid tiles, exac 阅读全文
posted @ 2017-09-15 23:53 少年啦飞驰 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 作为对象的创建模式,单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例。这个类称为单例类。 上面的例子中,在这个类被加载时,静态变量instance会被初始化,此时类的私有构造子会被调用。这时候,单例类的唯一实例就被创建出来了。 饿汉式其实是一种比较形象的称谓。既然饿,那么在创 阅读全文
posted @ 2016-03-14 10:33 少年啦飞驰 阅读(154) 评论(0) 推荐(0) 编辑
摘要:   ObjectInputStream 和 ObjectOutputStream 的作用是,对基本数据和对象进行序列化操作支持。创建“文件输出流”对应的ObjectOutputStream对象,该ObjectOutputStream对象能提供对“基本数据或对象”的持久存储;当我们需要读取这些存储的“ 阅读全文
posted @ 2016-03-13 21:55 少年啦飞驰 阅读(1785) 评论(0) 推荐(0) 编辑
摘要:   锁就是防止其他事务访问指定的资源的手段。锁是实现并发控制的主要方法,是多个用户能够同时操纵同一个数据库中的数据而不发生数据不一致现象的重要保障。 一般来说,锁可以防止脏读、不可重复读和幻觉读。   事务并发产生的问题:        脏读:一个事务读取到了另外一个事务没有提交的数据        阅读全文
posted @ 2016-03-13 17:01 少年啦飞驰 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 前面对"独占锁"和"共享锁"有了个大致的了解;本章,我们对CountDownLatch进行学习。和ReadWriteLock.ReadLock一样,CountDownLatch的本质也是一个"共享锁"。本章的内容包括:CountDownLatch简介CountDownLatch数据结构CountDo 阅读全文
posted @ 2016-03-12 23:18 少年啦飞驰 阅读(386) 评论(0) 推荐(0) 编辑
摘要: 一个对象持有虚引用跟没有引用一样,就是没其他引用指向他。必须配合 引用队列ReferenceQueue(调用remove时如果没有被GC收集到这个引用对象的话会阻塞线程!) 一个对象持有弱引用,若只有Reference的referent指向他,不管当前内存空间足够与否,都会回收它的内存。 软引用与若 阅读全文
posted @ 2016-03-11 12:02 少年啦飞驰 阅读(230) 评论(0) 推荐(0) 编辑