版本比较
2.1 总体复盘 / My 高精度板子.
正文
增加 16 行删除 16 行
93 行未改动9495969798991001011021031041051061071081091101111121135 行未改动1191201211221231241251261271281291301311321331341351361371381391401411421431441451461472 行未改动93 行未改动for (; ans.a[ans.len - 1] == 0 && ans.len > 1; ans.len--);return ans;}friend const BigInt operator/(const BigInt &a, const BigInt &b) {BigInt sum;BigInt ans = 0;ans.len = a.len;for(int i = a.len - 1; i >= 0; i--) {sum = sum * 10 + a.a[i];while(comp(sum, b) != -1) {sum = sum - b;ans.a[i]++;}}for (; ans.a[ans.len - 1] == 0 && ans.len > 1; ans.len--);return ans;}friend std::istream& operator>>(std::istream& is, BigInt &a) {std::string s;is >> s;5 行未改动return os;}};```#### T4在高精度板子的基础上直接写就行了:```cppBigInt res, sum = 1;void solve() {int n;std::cin >> n;for (BigInt i = 1; i <= n; i = i + 1) {for (BigInt j = 1; j <= i; j = j + 1) {sum = sum * j;}res = res + sum;sum = 1;}std::cout << res << std::endl;}```#### T5熟悉的题目。 先把输赢情况给打表打出来,然后进行周期性循环即可。---2 行未改动93 行未改动9495969798991001011021031041051061071081091101111121135 行未改动1191201211221231241251261271281291301311321331341351361371381391401411421431441451461472 行未改动93 行未改动for (; ans.a[ans.len - 1] == 0 && ans.len > 1; ans.len--);return ans;}friend const BigInt operator/(const BigInt &a, const BigInt &b) {BigInt sum;BigInt ans = 0;ans.len = a.len;for(int i = a.len - 1; i >= 0; i--) {sum = sum * 10 + a.a[i];while(comp(sum, b) != -1) {sum = sum - b;ans.a[i]++;}}for (; ans.a[ans.len - 1] == 0 && ans.len > 1; ans.len--);return ans;}friend std::istream& operator>>(std::istream& is, BigInt &a) {std::string s;is >> s;5 行未改动return os;}};```#### T4在高精度板子的基础上直接写就行了:```cppBigInt res, sum = 1;void solve() {int n;std::cin >> n;for (BigInt i = 1; i <= n; i = i + 1) {for (BigInt j = 1; j <= i; j = j + 1) {sum = sum * j;}res = res + sum;sum = 1;}std::cout << res << std::endl;}```#### T5熟悉的题目。 先把输赢情况给打表打出来,然后进行周期性循环即可。---2 行未改动