1754: [Usaco2005 qua]Bull Math
1754: [Usaco2005 qua]Bull Math
Time Limit: 5 Sec Memory Limit: 64 MB
Submit: 398 Solved: 242
[Submit][Status][Discuss]
Description
Input
Output
Sample Input
1111111111
Sample Output
HINT
Source
题解:萌萌哒高精度乘法= =
/**************************************************************
Problem:
User: HansBug
Language: Pascal
Result: Accepted
Time: ms
Memory: kb
****************************************************************/ var
i,j,k,l,m,n:longint;
a,b,c:array[..] of longint;
s1,s2:ansistring;
begin
readln(s1);
readln(s2);
a[]:=length(s1);
for i:= to a[] do a[i]:=ord(s1[a[]+-i])-;
b[]:=length(s2);
for i:= to b[] do b[i]:=ord(s2[b[]+-i])-;
c[]:=a[]+b[];
for i:= to a[] do
for j:= to b[] do
begin
c[i+j-]:=c[i+j-]+a[i]*b[j];
c[i+j]:=c[i+j]+c[i+j-] div ;
c[i+j-]:=c[i+j-] mod ;
end;
while (c[]>) and (c[c[]]=) do dec(c[]);
for i:=c[] downto do write(c[i]);
writeln;
readln;
end.
1754: [Usaco2005 qua]Bull Math的更多相关文章
- BZOJ 1754: [Usaco2005 qua]Bull Math
Description Bulls are so much better at math than the cows. They can multiply huge integers together ...
- 【BZOJ】1754: [Usaco2005 qua]Bull Math
[算法]高精度乘法 #include<cstdio> #include<algorithm> #include<cstring> using namespace s ...
- bzoj 1754: [Usaco2005 qua]Bull Math【高精乘法】
高精乘法板子 然而WA了两次也是没救了 #include<iostream> #include<cstdio> #include<cstring> using na ...
- BZOJ1754: [Usaco2005 qua]Bull Math
1754: [Usaco2005 qua]Bull Math Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 374 Solved: 227[Submit ...
- Poj OpenJudge 百练 2389 Bull Math
1.Link: http://poj.org/problem?id=2389 http://bailian.openjudge.cn/practice/2389/ 2.Content: Bull Ma ...
- bzoj1751 [Usaco2005 qua]Lake Counting
1751: [Usaco2005 qua]Lake Counting Time Limit: 5 Sec Memory Limit: 64 MB Submit: 168 Solved: 130 [ ...
- 1755: [Usaco2005 qua]Bank Interest
1755: [Usaco2005 qua]Bank Interest Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 187 Solved: 162[Su ...
- 1753: [Usaco2005 qua]Who's in the Middle
1753: [Usaco2005 qua]Who's in the Middle Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 290 Solved: ...
- 1751: [Usaco2005 qua]Lake Counting
1751: [Usaco2005 qua]Lake Counting Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 190 Solved: 150[Su ...
随机推荐
- java UUID的创建
java UUID的创建: 参考:http://blog.csdn.net/yaerfeng/article/details/7070369 可以研究一下最后的一段代码: http://spiritf ...
- jQuery内容过滤器
jQuery内容过滤器 <h1>this is h1</h1> <div id="p1"> <h2>this is h2</h ...
- Bootstrap入门(十九)组件13:页头与缩略图
Bootstrap入门(十九)组件13:页头与缩略 1.页头 2.默认的缩略图 3.自定义缩略图 页头组件能够为 h1 标签增加适当的空间,并且与页面的其他部分形成一定的分隔.它支持 h1 标签内内嵌 ...
- RabbitMQ小白菜学习之在window下的安装配置
RabbitMQ安装 首先需要下载RabbitMQ的平台环境Erlang OTP平台和RabbitMQ Server(windows版): OTP 19.1 Windows 64-bit Binary ...
- TCP&UDP
TCP(传输控制协议) 建立连接,形成传输数据的通道 在连接中进行大数据传输(数据大小不受限制) 通过三次握手完成连接,是可靠协议,安全送达(三次握手向服务器发送请求,响应请求回复,发送数据) 必须建 ...
- linux脚本: 后台启动程序并重定向输出信息脚本
后台启动程序并重定向输出信息脚本 新建文件mstart, 写入下面代码. #!/bin/bash $1 1>/etc/null 2>&1 & 说明 1>/etc/nu ...
- C# 结构体 枚举类型
注意:枚举类型和结构体都属于值类型. 结构体:就是一个自定义的集合,里面可以放各种类型的元素,用法大体跟集合一样. 一.定义的方法: struct student { public int nianl ...
- JAVA中的访问修饰符和包
一.JAVA访问修饰符 访问修饰符,用来控制类中成员的可见性 有四个访问修饰符,分别是:default,private,public,protected 1.default(默认):默认权限,不用写的 ...
- block之---应用场景:做参数和返回值
1.做参数 什么时候使用Block充当参数? 封装一个功能,这个功能做什么事情由外界决定,但是什么时候调用由内部决定,这时候就需要把Block充当参数去使用. 模拟需求: 封装一个计算器,怎么计算由外 ...
- mongodb终端指令
-h [--help]显示此使用信息 --version显示版本信息 -f [--config] arg配置文件指定 ...