为什么这个高精乘法不对?
  • 板块学术版
  • 楼主Carey_chen
  • 当前回复3
  • 已保存回复3
  • 发布时间2022/4/13 20:34
  • 上次更新2023/10/28 03:48:51
查看原帖
为什么这个高精乘法不对?
516836
Carey_chen楼主2022/4/13 20:34

代码:


#include <bits/stdc++.h>

using namespace std; 


struct BigInteger
{
	static const int BASE = 100000000;
	static const int WIDTH = 8;
	vector <int> s;
	long long len;

    BigInteger operator * (const BigInteger& b) 
	{
        BigInteger c; 
		c.len = len + b.len;
        for(int i = 0; i < len; i++)
        {
		    for(int j = 0; j < b.len; j++)
            {
                c.s[i+j] += s[i] * b.s[j];```
            }
		}
};

记录 [:]https://www.luogu.com.cn/record/73852383

2022/4/13 20:34
加载中...