【PAT】Emergency(最短路条数-SPFA)
As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of res...
分类:
其他好文 时间:
2016-05-13 04:29:41
阅读次数:
415
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house...
分类:
其他好文 时间:
2016-05-12 22:36:06
阅读次数:
138
在编写一个类时,如果该类中的代码可能运行于多线程环境下,那么就要考虑同步的问题。在Java中内置了语言级的同步原语--synchronized,这也大大简化了Java中多线程同步的使用。我们写一个银行转账的多线程问题:
class Account {
String name;
float amount;
public Account(Stri...
分类:
其他好文 时间:
2016-05-12 21:47:21
阅读次数:
126
As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the le...
分类:
其他好文 时间:
2016-05-12 18:31:00
阅读次数:
139
Given a list of monetary amounts in a standard format, please calculate the total amount.We define the format as follows:
The amount starts with ‘$’.
The amount could have a leading ‘0’ if and only if...
分类:
其他好文 时间:
2016-05-12 17:26:02
阅读次数:
149
House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constrain ...
分类:
其他好文 时间:
2016-05-11 18:13:23
阅读次数:
165
#define DATA_SHIFT 2 #define SPEED_BIT 2 #define DATA_BEGIN 2+SPEED_BIT #define DATA_AMOUNT 5+720+SPEED_BIT for(i=DATA_BEGIN;i<DATA_AMOUNT-3;i+=DATA_S ...
分类:
其他好文 时间:
2016-05-09 12:31:53
阅读次数:
160
我先来设计一个类:有一个Account(银行账户)类,假设它有3个属性:amount(账户金额)、interestRate(利率)和owner(账户名)。 在这3个属性中,amount和owner会因人而异,不同的账户这些内容是不同的,而所有账户的interestRate都是相同的。 amount和 ...
分类:
编程语言 时间:
2016-05-03 12:14:21
阅读次数:
204
一、什么是load average? linux系统中的Load对当前CPU工作量的度量 (WikiPedia: the system load is a measure of the amount of work that a computer system is doing)。也有简单的说是进程 ...
分类:
系统相关 时间:
2016-05-02 18:35:36
阅读次数:
266
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo ...
分类:
编程语言 时间:
2016-05-01 17:31:34
阅读次数:
178