wait()、notify()/*
* wait()、notify()
*
* 1.两个方法都只能在synchronized代码块中执行,因为要对持有锁的线程操作,只有同步中才有锁
* 2.两个方法在操作同步中的线程时,必须要标识所操作线程持有的对象锁
* 3.等待和唤醒必须是同一个对象锁
*/
public class Test05 {
public static void...
分类:
编程语言 时间:
2015-03-30 09:21:30
收藏:
0 评论:
0 赞:
0 阅读:
259
死锁/*
* 死锁:多个线程使用不同的锁,每个线程都需要另一个线程持有的锁
* 出现:同步的嵌套
*
*/
public class Test01 {
public static void main(String[] args) {
Tom tom = new Tom();
Alice alice = new Alice();
MyT...
分类:
编程语言 时间:
2015-03-30 09:21:26
收藏:
0 评论:
0 赞:
0 阅读:
302
1405. Mahershalalhashbaz, Nebuchadnezzar, and Billy Bob Benjamin Go to the Regionals
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
The Association for Computing Mac...
分类:
其他 时间:
2015-03-30 09:21:10
收藏:
0 评论:
0 赞:
0 阅读:
224
1459. The Dragon of Loowater
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.
...
分类:
其他 时间:
2015-03-30 09:21:00
收藏:
0 评论:
0 赞:
0 阅读:
239
Specialized Four-Digit Numbers
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 4603 Accepted Submission(s): 3344
Problem Description
...
分类:
其他 时间:
2015-03-30 09:20:50
收藏:
0 评论:
0 赞:
0 阅读:
231
1484. 守望者的逃离
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
恶魔猎手尤迪安野心勃勃,他背叛了暗夜精灵,率领深藏在海底的娜迦族企图叛变。守望者在与尤迪安的交锋中遭遇了围杀,被困在一个荒芜的大岛上。为了杀死守望者,尤迪安开始对这个荒岛施咒,这座岛很快就会沉下去。到那时,岛上的...
分类:
其他 时间:
2015-03-30 09:20:50
收藏:
0 评论:
0 赞:
0 阅读:
219
1234. Playground
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
George has K <= 20 steel wires shaped in the form of half-circles, with radii a1, a2, . . . , aK. The...
分类:
其他 时间:
2015-03-30 09:20:30
收藏:
0 评论:
0 赞:
0 阅读:
256
9456. Clumsy Cows
Constraints
Time Limit: 1 secs, Memory Limit: 256 MB
Description
Bessie the cow is trying to type a balanced string of parentheses into her new laptop, but she is s...
分类:
其他 时间:
2015-03-30 09:20:20
收藏:
0 评论:
0 赞:
0 阅读:
229
1426. Phone List
Constraints
Time Limit: 1 secs, Memory Limit: 64 MB
Description
Given a list of phone numbers, determine if it is consistent in the sense that no number is the pre?x...
分类:
其他 时间:
2015-03-30 09:20:10
收藏:
0 评论:
0 赞:
0 阅读:
216
1422. Table Tennis
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
There is a rectangular pool table ABCD with side lengths m and n, where m and n are integers with m...
分类:
其他 时间:
2015-03-30 09:20:00
收藏:
0 评论:
0 赞:
0 阅读:
219
10330. Cutting Sausages
Constraints
Time Limit: 1 secs, Memory Limit: 256 MB
Description
Mirko has given up on the difficult coach job and switched to food tasting instead. Having sk...
分类:
其他 时间:
2015-03-30 09:19:50
收藏:
0 评论:
0 赞:
0 阅读:
237
1763. 传球游戏
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
上体育课的时候,小蛮的老师经常带着同学们一起做游戏。这次,老师带着同学们一起做传球游戏。
游戏规则是这样的:n个同学站成一个圆圈,其中的一个同学手里拿着一个球,当老师吹哨子时开始传球,每...
分类:
其他 时间:
2015-03-30 09:19:40
收藏:
0 评论:
0 赞:
0 阅读:
636
1764. 立体图
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
小渊是个聪明的孩子,他经常会给周围的小朋友们讲些自己认为有趣的内容。最近,他准备给小朋友们讲解立体图,请你帮他画出立体图。
小渊有一块面积为m*n的矩形区域,上面有m*n个边长为1的格子,每个格子上堆了一些同样...
分类:
其他 时间:
2015-03-30 09:19:30
收藏:
0 评论:
0 赞:
0 阅读:
166
1781. Knight
Constraints
Time Limit: 1 secs, Memory Limit: 64 MB
Description
Your task is to write a program to calculate the minimum number of moves needed for a knight to reach one...
分类:
其他 时间:
2015-03-30 09:19:20
收藏:
0 评论:
0 赞:
0 阅读:
216
1936. Knight Moves
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the s...
分类:
其他 时间:
2015-03-30 09:19:10
收藏:
0 评论:
0 赞:
0 阅读:
203
1299. Academy Awards
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
Selected from 3,850 teams from 1,329 universities in 68 countries competing at 106 sites and prel...
分类:
其他 时间:
2015-03-30 09:19:00
收藏:
0 评论:
0 赞:
0 阅读:
238
1893. Sell Ticket
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
One day, little pig wants to go to the park for fun. He has just one piece of five dollar and luckil...
分类:
其他 时间:
2015-03-30 09:18:50
收藏:
0 评论:
0 赞:
0 阅读:
223
1934. 移动小球
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
你有一些小球,从左到右依次编号为1,2,3,...,n. 你可以执行两种指令(1或者2)。其中, 1 X Y表示把小球X移动到小球Y的左边, 2 X Y表示把小球X移动到小球Y右边。 指令保证合法,即X不等于Y。 ...
分类:
移动平台 时间:
2015-03-30 09:18:40
收藏:
0 评论:
0 赞:
0 阅读:
272
1938. Message Flood
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
Well, how do you feel about mobile phone? Your answer would probably be something like that “It’s...
分类:
其他 时间:
2015-03-30 09:18:30
收藏:
0 评论:
0 赞:
0 阅读:
196
2002. Feeding Time
Constraints
Time Limit: 1 secs, Memory Limit: 292.96875 MB
Description
It's Bessie's feeding time, and Farmer John is trying to decide where to put her. FJ has a f...
分类:
其他 时间:
2015-03-30 09:18:20
收藏:
0 评论:
0 赞:
0 阅读:
207