![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
大整数
tomjobs
别慌,慌也没用
展开
-
I - Sum of Palindromes Gym - 102576I(大整数)
题意: 给你一个很大的数(1e5位),求不超过25个回文数和为这个数。 思路: 直接找尽量接近这个数的回文数,减去就好了。 收获是进一步熟悉了这个大整数板子(定义数组也是要时间的啊) #pragma comment(linker, "/STACK:102400000,102400000") #include <iostream> #include <string> #include <cstring> #include <cstdio> #include &.原创 2020-10-03 22:04:09 · 227 阅读 · 0 评论 -
The Crime-solving Plan of Groundhog(大整数乘法)
题意: 0~9每个数字都给你一些,要求配成两个没有前导0的数字,使得乘积最小。 思路: 第二个数字为一个的时候乘积最小,所以直接模拟乘法。 #include <cstdio> #include <cstring> #include <algorithm> #include <map> #include <vector> using namespace std; typedef long long ll; const int maxn = 2e6原创 2020-08-12 19:10:16 · 213 阅读 · 0 评论 -
牛客多校第九场 Groundhog and 2-Power Representation(大整数,java)
思路: 直接java模拟递归写。 不过python貌似可以用语法直接写。 import java.util.*; import java.math.*; import java.io.*; import java.lang.*; public class Main { public static BigInteger qpow(BigInteger n) { BigInteger res = BigInteger.ONE; BigInteger zero = .原创 2020-08-12 18:59:48 · 163 阅读 · 0 评论 -
2019湖南省赛 组合数(int128)
组合数 给出 nnn 和 kkk,求 minn!k!(n−k)!,1018\min{\frac{n!}{k! (n - k)!}, 10^{18}}mink!(n−k)!n!,1018 的值。 其中 n!=1×2×⋅×nn! = 1 \times 2 \times \cdot \times nn!=1×2×⋅×n 表示 nnn 的阶乘。 输入格式 输入文件包含多组数据,请处理到文件结束。 每组...原创 2020-03-03 21:32:20 · 369 阅读 · 0 评论 -
高精度算法之加 减 乘 除 阶乘和
如果是寻找高精度(大整数)类,请转移到 https://blog.csdn.net/tomjobs/article/details/99988413 或 https://blog.csdn.net/tomjobs/article/details/101856803 这里只是简单的数组模拟,巩固一下基础。 高精度加法:直接一位一位的加就好了,大于10就进到下一位 #include <cstdi...原创 2020-01-30 17:14:11 · 316 阅读 · 0 评论 -
Crazy Thairs POJ - 3378(10000进制加法 树状数组)
These days, Sempr is crazed on one problem named Crazy Thair. Given N (1 ≤ N ≤ 50000) numbers, which are no more than 109, Crazy Thair is a group of 5 numbers {i, j, k, l, m} satisfying: 1 ≤ i < ...原创 2020-01-24 16:06:57 · 4493 阅读 · 0 评论 -
Revenge of Fibonacci HDU - 4099(字典树,高精度)
The well-known Fibonacci sequence is defined as following: Here we regard n as the index of the Fibonacci number F(n). This sequence has been studied since the publication of Fibonacci’s book Liber Ab...原创 2019-10-29 16:01:47 · 183 阅读 · 0 评论 -
Strassen(百度之星,大整数模板)
Strassen Accepts: 567 Submissions: 7005 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description 在本题中,我们只有两种方法计算两个n\times nn×n的矩阵的乘积,第一种为定义法,需要n^3n 3 ...原创 2019-08-25 23:56:33 · 281 阅读 · 0 评论 -
AcWing 307. 连通图 poj1737(计数类dp,高精度)
求 N 个节点的无向连通图有多少个,节点有标号,编号为1~N。 例如下列图示,三个节点的无向连通图共4个。 1737_1.jpg 输入格式 输入包含多组测试数据。 每组数据包含一个整数N。 当输入为0时,表示输入终止。 输出格式 每组测试数据输出一个结果,每个结果占一行。 数据范围 1≤N≤50 输入样例: 1 2 3 4 0 输出样例: 1 1 4 38 思路: f[i] = 2i*(i-1)/...原创 2019-10-01 18:42:36 · 248 阅读 · 0 评论