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 ...
随机推荐
- HTML5 Canvas、内联 SVG、Canvas vs. SVG
canvas 元素用于在网页上绘制图形. 什么是 Canvas? HTML5 的 canvas 元素使用 JavaScript 在网页上绘制图像. 画布是一个矩形区域,您可以控制其每一像素. canv ...
- LazyInitializationException--由于session关闭引发的异常
1,页面中进行person.department.departmentName的读取 2,Action 中只读取了person,事务作用在Service的方法中 3,后台会有org.hibernate ...
- SimRank协同过滤推荐算法
在协同过滤推荐算法总结中,我们讲到了用图模型做协同过滤的方法,包括SimRank系列算法和马尔科夫链系列算法.现在我们就对SimRank算法在推荐系统的应用做一个总结. 1. SimRank推荐算法的 ...
- SQL 存储过程 触发器 事务
一.存储过程 存储过程:就像函数一样的会保存在:数据库中-->可编程性 --> 存储过程 创建存储过程:create proc JiaFa --存储关键字proc @a int, ...
- angular1.5 Components
如今前端界angular react vue三大框架并驾齐驱,其中有一个共同点就是组件化开发,这也符合w3c 推行Web Components的趋势.现如今不懂组件化开发的前端绝对不是好厨子.跳槽新公 ...
- shiro.ini 配置详解
引用: [1]开涛的<跟我学shiro> [2]<SpringMVC整合Shiro> [3]<shiro简单配置> [4]Apache shiro集群实现 (一) ...
- c#入门系列——番外篇:vs的安装与使用
vs的安装 1.安装条件 vs全称visual studio 它是一个开发平台,不仅可以用于c#开发,别的也可以.安装vs前,首先需要一个安装包.安装包可以在网上下载.没有购买版权的 ...
- C语言 动态创建二维数组
/*C语言 如何动态创建二维数组 转化为一维数组申请数组,创建和释放都比较简单 */ #include <stdlib.h> #include <stdio.h> #inclu ...
- sqlite数据库学习
1.0版代码: package com.swust.sqlitedatabase.test; import com.swust.sqlitedatabase.myOpenHelper; import ...
- Sublime Text 中文乱码解决方案
1.到这里下载安装PackageControl https://packagecontrol.io/installation#Manual 完成重启Sublime Text: 2.按Ctrl+Shif ...