当前位置:文档之家› ACM题目

ACM题目

可怜的毅毅
时间限制(普通/Java):1000MS/10000MS 运行内存限制:65535KByte
总提交:698 测试通过:201

描述


毅毅刚刚上小学三年级。有一天,老师给他出了一道十进制数的加法题目,1+1=几。结果毅毅做错了,老师很不高兴,罚毅毅回家做N道大整数的加法(最大有80位)。可怜的毅毅需要你的帮助……


输入


本题有多组测试数据,每组测试数据有两行,分别表示两个非负整数。


输出

对每组测试数据输出一行,表示两数之和。

样例输入

1
1
123
456


样例输出

2
579

提示

Leading zeros should be ignored.

题目来源

xFengChenx


数塔问题
时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte
总提交:386 测试通过:183

描述


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 numbers passed on a route that starts at the top and ends somewhere on the base. Each step can go either diagonally down to the left or diagonally down to the right.


输入

Your program is to read from standard input. There are several test cases.For each case ,the first line contains one integer N: the number of rows in the triangle. The following N lines describe the data of the triangle. The number of rows in the triangle is > 1 but <= 100. The numbers in the triangle, all integers, are between 0 and 99. The end of input is indicated by N = 0 .

输出

Your program is to write to standard output. The highest sum is written as an integer.

样例输入

5
7
3 8
8 1 0
2 7 4 4
4 5 2 6 5
0

样例输出

30

题目来源

IOI 1994




高精度乘法
时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte
总提交:125 测试通过:38

描述


如题。


输入


多组数据.

一组数据对应2行,前一行是a,后一行是b.(a b前后没有多余空格)


a b均不超过10000位。


输出


若干行
每行为相应a*b的积


样例输入

1
2
2
5

样例输出

2
10


题目来源

xlx

题目上传者

lydxlx



[提交] [提交状况] [讨论版]


|返回 | | 转到页头|


Current Administrator(s): Yan Hao (Contact)
Administrators in history: Xiang Shuo (Contact); Wang cai (Contact)
Designed & Developed by Weitong Lee. Copyright ? 2006-2009 NUAA ACM Team,NUAA Computer Competition & Practice Association
All Rights Reserved.



红豆玲珑骰
时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte
总提交:125 测试通过:42

描述


玲珑骰子安红豆,入骨相思知不知。——[唐]温庭筠

GoldenSun的梦境——

自己原来是风流才子温庭筠转世的化身!今天是情人节,在hh4742

的建议下,他和美女Yoyo_Yao抛弃了那些老套的情人节项目,玩起了hh4742淘宝得来的红豆玲珑骰。

红豆玲珑骰一共六面,每一面上有+、-、*其中之一的符号。每当骰子落下后,hh4742的两条卷轴就会自动打开,上面分别显示有一个整数。

你所要做的工作,就是将这两个整数用骰子朝上的一面上显示的符号运算得出结果。


输入


第一行,骰子上显示的符号。

第二行,一个整数a。

第三行,一个整数b。

(-10^69<=a,b<=10^69)


输出


输出文件共一行,即计算得来的结果。


样例输入

*
-50
6


样例输出

-300


题目来源

宜昌市一中第九届模拟赛之情人节系列



多米诺骨牌(Domino)
时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte
总提交:201 测试通过:36

描述

有N块1×2大小的骨牌需要放入一个2×N的牌盒中,请问共有多少种放法(输出总放法数的最后100位即可)。

输入

输入数据仅一个自然数N(N≤10^6)。

输出

输出数据共4行,每行25位,共100位。表示总放法数的最后100位。不满100位时高位用0补足。

样例输入

5


样例输出

0000000000000000000000000
0000000000000000000000000
0000000000000000000000000
0000000000000000000000008


题目来源

jsoi2006



[提交] [提交状况] [讨论版]


|返回 | | 转到页头|





相关主题
文本预览
相关文档 最新文档