高精乘法板子 然而WA了两次也是没救了 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=105; int la,lb,lc,a[N],b[N],c[N],tot; char ch[N]; int main() { scanf("%s",ch+1); la=strlen(ch+1); for(int i=1;i<=la;i…
Description Bulls are so much better at math than the cows. They can multiply huge integers together and get perfectly precise answers ... or so they say. Farmer John wonders if their answers are correct. Help him check the bulls' answers. Read in tw…
1754: [Usaco2005 qua]Bull Math Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 398  Solved: 242[Submit][Status][Discuss] Description Bulls are so much better at math than the cows. They can multiply huge integers together and get perfectly precise answ…
[算法]高精度乘法 #include<cstdio> #include<algorithm> #include<cstring> using namespace std; ; char s1[maxn],s2[maxn]; int a[maxn],b[maxn],c[maxn],lena,lenb,lenc; int main(){ scanf("%s%s",s1,s2); lena=strlen(s1);lenb=strlen(s2); ;i<…
1754: [Usaco2005 qua]Bull Math Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 374  Solved: 227[Submit][Status] Description Bulls are so much better at math than the cows. They can multiply huge integers together and get perfectly precise answers ... o…
3287: Mato的刷屏计划 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 124  Solved: 43[Submit][Status] Description Mato同学喜欢上QQ,但是有少数傻逼总是问他一些弱智问题.Mato感到很反感,想要鄙视一下他们.他决定在QQ上刷屏,也就是发出一大堆字符.Mato的键盘上有4个键:A.B.C.D.按A就会输入一个字符,按B会把所有字符选中,按C会把选中的字符放入剪贴板,按D会插入剪贴板的内容.他的…
原来强行转int可以避免四舍五入啊 #include<iostream> #include<cstdio> using namespace std; int r,y; double m; int main() { scanf("%d%lf%d",&r,&m,&y); double l=1.0+(double)r/100.0; for(int i=1;i<=y;i++) m*=l; printf("%d\n",(i…
--这可能是早年Pascal盛行的时候考排序的吧居然还是Glod-- #include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int N=100005; int n,a[N]; int read() { int r=0,f=1; char p=getchar(); while(p>'9'||p<'0') { if(p=='-') f=-1; p=ge…
这题的话思路挺简单的,主要是打一个高精乘,然后考虑一些细节的东西 码得挺少时间的,但是调错调了很久... 讲一下思路吧: 就是读入的时候,先把小数点去掉,mark一下小数点的位置 去掉小数点之后也就进行高精乘法即可,去掉前导零 之后计算一下小数点的位置 再去掉小数点后多余的零 以及特判k=1的情况,直接输出答案 细节的地方主要就是在模拟上吧, 我WA了几次: 1.当小数点后面没有数字的时候,当然不需要输出小数点...这个没有考虑进去 2.没有特判k=1的情况,因为答案是放在c数组里,所以当k=1…
洛谷P1066:https://www.luogu.org/problemnew/show/P1066 思路 挺难的一道题 也很复杂 满足题目要求的种数是两类组合数之和 r的最多位数m为 w/k(当w mod k=0 时) w/k+1(当 w mod k=1 时) First: 位数为2~m的种数 即从2k-1中不重复地取i个的组合数(只取到2k-1是因为2k会进位) 即C(2k-1,2)+C(2k-1,3)+...+C(2k-1,m) Second: 位数为m+1的种数 因为要每个数严格小于左…