- 博客(13)
- 资源 (2)
- 问答 (1)
- 收藏
- 关注
原创 多线程
实现方式 1.继承Thread 2.实现Runnable 3.创建Executor线程池 { a. newCachedThreadPool 创建一个可缓存线程池,如果线程池长度超过处理需要,可灵活回收空闲线程,若无可回收,则新建线程。 b. newFixedThreadPool 创建一个定长线程池,可控制线程最大并发数,超出的线程会在队列中等待。 c...
2018-04-18 15:11:41 108
原创 KiKi's K-Number
Problem DescriptionFor the k-th number, we all should be very familiar with it. Of course,to kiki it is also simple. Now Kiki meets a very similar problem, kiki wants to design a container, the contai...
2013-08-19 21:22:48 440
原创 A Simple Problem with Integers
Problem DescriptionLet A1, A2, ... , AN be N elements. You need to deal with two kinds of operations. One type of operation is to add a given number to a few numbers in a given interval. The other is ...
2013-08-19 16:31:13 441
原创 Minimum Inversion Number
Problem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj.For a given sequence of numbers a1, a2, ..., an,...
2013-08-19 12:05:33 443
原创 搬寝室
Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度是和左右...
2013-08-18 22:49:12 576
原创 Zipper
Font Size: ← →Problem DescriptionGiven three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The first two strings can be mix...
2013-08-18 20:20:41 569
原创 Humble number
Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 2...
2013-08-18 16:08:37 534
原创 Encoded Barcodes
Problem DescriptionAll the big malls need a powerful system for the products retrieval. Now you are employed design a sub-system: reading the barcodes and return the matching products.A barcode is an ...
2013-08-18 15:14:07 466
原创 rober ration
Problem DescriptionA robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions are N...
2013-08-18 08:53:04 597
原创 hotal
Problem DescriptionLast year summer Max straveled to California for his vacation. He had a great time there: took many photos, visited famous universities, enjoyed beatiful beaches and tasted various ...
2013-08-17 20:16:37 750
原创 河床
Problem Description地理学家们经常要对一段河流进行测量分析。他们从上游开始向下游方向等距离地选择了n(<=30000)个点测量水位深度。得到了一组数据d1,d2,…dn,回到实验室后数据分析员需要对数据进行分析,发掘隐藏在数据背后的规律。最近,乌龙博士发现某种水文现象与河床地势有关,于是他指示分析员要找出一段河流中最大高低起伏差不超过k(<=100)的最长一段。这看似...
2013-08-17 16:17:57 679
原创 How to style
#include<iostream> #include<stdio.h> #include<cstdio> using namespace std; int min(int a,int b) { if(a<b) return a; return b; } int m1[110]; int m2[110]; char mp[110]; int ...
2013-08-17 15:25:57 477
原创 猴子
Problem Description一只猴子找到了很多香蕉树,这些香蕉树都种在同一直线上,而猴子则在这排香蕉树的第一棵树上。这只猴子当然想吃尽量多的香蕉,但它又不想在地上走,只想从一棵树跳到另外一棵树上。同时猴子的体力有限,它不能一次跳到太远或跳得次数太多。每当它跳到一棵树上,就会把那棵树上的香蕉都吃掉。那么它最多能吃多少个香蕉呢?Input输入的第1行为三个整数,分别是香蕉树的棵树N,猴子每次...
2013-08-17 14:42:51 735
Android开发相关的类文件问题
2015-05-14
TA创建的收藏夹 TA关注的收藏夹
TA关注的人