![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
高精度 + FFT + FWT
文章平均质量分 67
qq_37383726
这个作者很懒,什么都没留下…
展开
-
N!的位数 【java 高精度处理】
Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! Input One N in one line, process to the end of file. Output For each N, output N! in one line. Sample Input 1 2 3 Sample Outp原创 2017-07-12 19:11:54 · 377 阅读 · 0 评论 -
[牛客网暑期ACM多校训练营(第八场)] H Playing games [二分+FWT]
Niuniu likes playing games. He has n piles of stones. The i-th pile has ai stones. He wants to play with his good friend, UinUin. Niuniu can choose some piles out of the n piles. They will play with t...原创 2018-08-17 14:37:44 · 326 阅读 · 0 评论 -
[牛客网暑期ACM多校训练营(第九场)] A Circulant Matrix [FWT]
链接:https://www.nowcoder.com/acm/contest/147/A 来源:牛客网Niuniu has recently learned how to use Gaussian elimination to solve systems of linear equations. Given n and a[i], where n is a power of 2, let...原创 2018-08-17 15:57:13 · 169 阅读 · 0 评论 -
【哈尔滨理工大学第七届程序设计竞赛初赛(低年级组)】A B C D E F H I
A 蓝廋、香菇//package FirstTime;import java.util.*;import java.math.*;import java.text.DecimalFormat;public class Main{ public static void main(String[] agrs){ Scanner cin = new Scanner(Syste原创 2017-12-14 23:00:32 · 356 阅读 · 0 评论 -
【hihoCoder 1650】扁平化管理 【java 二分】
扁平化管理 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi的公司包括CEO在内一共有N名员工。这N名员工的上下级关系形成树形结构,CEO处于树根,普通员工处于叶子节点。 现在公司希望管理扁平化,要求树形结构中的层级不超过L层。此外,假设A是B的直接上级,那么B管理的下属数目必须少于A管理的下属数目。 请你判断CEO至少要管理多少名下属?例如N=12原创 2017-12-06 22:38:03 · 302 阅读 · 0 评论 -
【FZU - 2278】- YYS 【java高精度 + 期望计算】
Yinyangshi is a famous RPG game on mobile phones.Kim enjoys collecting cards in this game. Suppose there are n kinds of cards. If you want to get a new card, you need to pay W coins to draw a card. Eac原创 2017-08-21 17:39:17 · 391 阅读 · 0 评论 -
大菲波数 【java 高精度处理】
大菲波数Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 20029 Accepted Submission(s): 6732Problem Description Fibonacci数列,定义如下: f(1)=f(2)=1 f原创 2017-07-13 19:14:27 · 188 阅读 · 0 评论 -
Exponentiation 【java 处理高精度】
ExponentiationTime Limit: 2000/500 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9530 Accepted Submission(s): 2827Problem Description Problems involving the co原创 2017-07-13 20:14:17 · 311 阅读 · 0 评论 -
How Many Fibs? 【java 处理高精度】
How Many Fibs?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6481 Accepted Submission(s): 2569Problem Description Recall the definition of原创 2017-07-13 19:38:57 · 306 阅读 · 0 评论 -
大明A+B 【java 处理高精度】
Problem Description 话说,经过了漫长的一个多月,小明已经成长了许多,所以他改了一个名字叫“大明”。 这时他已经不是那个只会做100以内加法的那个“小明”了,现在他甚至会任意长度的正小数的加法。现在,给你两个正的小数A和B,你的任务是代表大明计算出A+B的值。Input 本题目包含多组测试数据,请处理到文件结束。 每一组测试数据在一行里面包含两个长度不大于400的正小数A和原创 2017-07-13 19:01:54 · 335 阅读 · 0 评论 -
java 处理高精度问题
在用C或者C++处理大数时 会非常麻烦,要手动模拟,但是在JAVA中有两个类BigInteger和BigDecimal分别表示大整数类和大浮点数类,理论上能够表示无线大的数,只要计算机内存足够大。 这两个类都在java.math. * 包中,因此每次必须在开头处引用该包。 import java.math. * () ; import java.util.* ; —读取用的包。Ⅰ基本函数:原创 2017-07-12 19:07:53 · 450 阅读 · 0 评论 -
A + B Problem II 【java 高精度】
A + B Problem IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 364523 Accepted Submission(s): 70907Problem Description I have a very simpl原创 2017-07-12 21:23:38 · 311 阅读 · 0 评论 -
快速沃尔什变换 [FWT变换] 模板
原文链接 FWT变换是可以求: 给定两个数组 A 和 B (长度为2的整数幂): Ck=∑i⊕j=kAi·BiCk=∑i⊕j=kAi·BiC_k = \sum_{i \oplus j=k}A_i·B_i 其中⊕⊕\oplus可以是与,或,异或. 把 A 和 B 分别正变换,在一个好的复杂度得到 A 与 B 按位卷积的的正变换,最后再逆变换回来就是答案。 模板ll add(ll x,...原创 2018-08-17 11:36:07 · 294 阅读 · 0 评论