文章列表
POJ ACM习题【No.1004】
- 博客分类:
- ACM
Financial Management
Time Limit:
1000MS
Memory Limit:
10000K
Total Submissions:
47034
Accepted:
22985
Description
Larry
graduated this year and finally has a job. He's making a lot of money,
but somehow never seems to have enough. Larry has decided that he needs ...
- 2009-04-18 13:20
- 浏览 722
- 评论(0)
Hangover
Time Limit:
1000MS
Memory Limit:
10000K
Total Submissions:
42388
Accepted:
19686
Description
How
far can you make a stack of cards overhang a table? If you have one
card, you can create a maximum overhang of half a card length. (We're
assuming that t ...
- 2009-04-18 10:59
- 浏览 696
- 评论(0)
POJ ACM习题【No.1657】
- 博客分类:
- ACM
Distance on Chessboard
Time Limit:
1000MS
Memory Limit:
10000K
Total Submissions:
12505
Accepted:
4354
Description
国际象棋的棋盘是黑白相间的8 * 8的方格,棋子放在格子中间。如下图所示:
王、后、车、象的走子规则如下:
王:横、直、斜都可以走,但每步限走一格。
后:横、直、斜都可以走,每步格数不受限制。
车:横、竖均可以走,不能斜走,格数不限。
象:只能斜走,格数不限。
...
- 2009-04-18 10:06
- 浏览 800
- 评论(0)
All in All
Time Limit:
1000MS
Memory Limit:
30000K
Total Submissions:
11508
Accepted:
4497
Description
You
have devised a new encryption technique which encodes a message by
inserting between its characters randomly generated strings in a clever
way. Because of ...
- 2009-04-18 01:18
- 浏览 1367
- 评论(0)
POJ ACM习题【No.1504】
- 博客分类:
- ACM
Adding Reversed Numbers
Time Limit:
1000MS
Memory Limit:
10000K
Total Submissions:
6768
Accepted:
3826
Description
The
Antique Comedians of Malidinesia prefer comedies to tragedies.
Unfortunately, most of the ancient plays are tragedies. Therefore the
dramatic ad ...
- 2009-04-18 00:43
- 浏览 835
- 评论(0)
Look and Say
Time Limit:
5000MS
Memory Limit:
65536K
Total Submissions:
3802
Accepted:
2379
Description
The
look and say sequence is defined as follows. Start with any string of
digits as the first element in the sequence. Each subsequent element is
defined from ...
- 2009-04-18 00:11
- 浏览 664
- 评论(0)
The Triangle
Time Limit:
1000MS
Memory Limit:
10000K
Total Submissions:
13904
Accepted:
7977
Description
7
3 8
8 1 0
2 7 4 4
4 5 2 6 5
(Figure 1)
Figure
1 shows a number triangle. Write a program that calculates the highest
sum of n ...
- 2009-04-17 23:00
- 浏览 716
- 评论(0)
Cow Multiplication
Time Limit:
1000MS
Memory Limit:
65536K
Total Submissions:
4282
Accepted:
2847
Description
Bessie is tired of multiplying pairs of numbers the usual way, so she invented her own style of multiplication. In her style, A
*B
is equal to the sum ...
- 2009-04-17 22:14
- 浏览 762
- 评论(0)
Unhappy Jinjin
Time Limit:
1000MS
Memory Limit:
65536K
Total Submissions:
5571
Accepted:
4133
Description
Jinjin
is a junior school student. Besides the classes in school, Jinjin's
mother also arranges some supplementary classes for her. However, if
Jinjin studie ...
- 2009-04-15 23:57
- 浏览 743
- 评论(0)
Web Navigation
Time Limit:
1000MS
Memory Limit:
10000K
Total Submissions:
10805
Accepted:
4741
Description
Standard
web browsers contain features to move backward and forward among the
pages recently visited. One way to implement these features is to use
two stacks ...
- 2009-04-15 22:30
- 浏览 1044
- 评论(0)
求高精度幂
Time Limit:
500MS
Memory Limit:
10000K
Total Submissions:
48832
Accepted:
11250
Description
对数值很大、精度很高的数进行高精度计算是一类十分常见的问题。比如,对国债进行计算就是属于这类问题。
现在要你解决的问题是:对一个实数R( 0.0 < R < 99.999 ),要求写程序精确计算 R 的 n 次方(Rn
),其中n 是整数并且 0 < n <= 25。
Input
T输入包括多组 ...
- 2009-04-13 21:46
- 浏览 1170
- 评论(1)
POJ ACM习题【No.1000】:示例
- 博客分类:
- ACM
a加b
Time Limit
:1000MS
Memory Limit
:10000K
Description
Calculate a+b
Input
Two integer a,b (0<=a,b<=10)
Output
Output a+b
Sample Input
1 2
Sample Output
3
代码如下:
import java.util.*;
//Problem 1000
public class Main
{
public static void main( ...
- 2009-04-12 21:02
- 浏览 835
- 评论(0)
ACM国际大学生程序设计竞赛(英文全称:ACM International Collegiate Programming
Contest(ACM-ICPC或ICPC)是由美国计算机协会(ACM)主办的,一项旨在展示大学生创新能力、团队精神和在压力下编写程序、分析和解
决问题能力的年度竞赛。经过近30多年的发展,ACM国际大学生程序设计竞赛已经发展成为最具影响力的大学生计算机竞赛。赛事目前由IBM公司赞助。
北大ACM的地址:http://acm.pku.edu.cn
如何在北大ACM中提交问题的解答?
1.在北大ACM中注册并登陆
2.点击“Problems”按 ...
- 2009-04-12 20:35
- 浏览 2980
- 评论(0)
在Java开发中,合并字符串通常使用两种方式:
使用String的+=操作符,这种情况适用于小规模的字符串连接。
使用StringBuffer的append方法,适用于大规模的场景。
参见如下示例:
import java.util.*;
import java.math.*;
public class TestStringBuffer {
private static int LOOP_NUM = 10000;
private static List stringList = new ArrayList();
private static v ...
- 2009-04-12 02:23
- 浏览 780
- 评论(0)
1. Java的集合类有一个重要的局限:将对象置入集合中后,类型信息会被抛弃,但取出时则需要被显式指定为某种类型。所以不同种类的对象依然可以被置入同一个集合中。如下面的例子:
import java.util.*;
class Cat{
private int num;
Cat(int num){
this.num = num;
}
void print(){
System.out.println("Cat Number is " + this.num);
}
}
class Dog{
private int num; ...
- 2009-04-11 01:16
- 浏览 572
- 评论(0)