随笔分类 - 数学法
摘要:B. Pasha and Phonetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPasha has recently bought a new...
阅读全文
摘要:仔细观察就会发现K = pow(2, m) + pow(2, m-1) 数要翻转一次/************************************************* Author :Powatr* Created Time :2015/10/20 18:06:07...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4320/*公式:两个进制能相互转化,那么这两个进制的最小因数相同*//************************************************* Author :Powatr*...
阅读全文
摘要:http://acm.fzu.edu.cn/problem.php?pid=2148 /************************************************* Author :Powatr* Created Time :2015-8-23 18:28:5...
阅读全文
摘要:逆元 inv应用于取模运算中加法 (a + b) % p = a % p + b % p;减法 (a - b) % p = a % p - b % p;乘法 (a * b) % p = a % p * b % p;但是除法(a / b) % p :a * b % p = c;已知 b, c, p 求...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5392/*先把循环长度提取出来,再求这些长度的最小公倍数把质因数都分解出来,每个质因数取最大所有数之积就是最小公倍数*//**********************************************...
阅读全文
摘要:Today, Soda has learned a sequence whosen-th(n≥1)item is3n(n−1)+1. Now he wants to know if an integermcan be represented as the sum of some items of t...
阅读全文
摘要:Twilight Sparkle was playing Ludo with her friends Rainbow Dash, Apple Jack and Flutter Shy. But she kept losing. Having returned to the castle, Twili...
阅读全文
摘要:Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to. Then he measured the length of ...
阅读全文
摘要:Jeff's gotncards, each card contains either digit 0, or digit 5. Jeff can choose several cards and put them in a line so that he gets some number. Wha...
阅读全文
摘要:Math is very important, for those who are also in school, make sure you will learn more about math.Salmon and Cat are good friends.Today Salmon ask Ca...
阅读全文
摘要:ProblemA Communist regime is trying to redistribute wealth in a village. They have have decided to sit everyone around a circular table. First, everyo...
阅读全文
摘要:Mike is the president of country What-The-Fatherland. There arenbears living in this country besides Mike. All of them are standing in a line and they...
阅读全文
摘要:Mike has a frog and a flower. His frog is named Xaniar and his flower is named Abol. Initially(at time0), height of Xaniar ish1and height of Abol ish2...
阅读全文
摘要:Two soldiers are playing a game. At the beginning first of them chooses a positive integernand gives it to the second soldier. Then the second one tri...
阅读全文
摘要:Problem DescriptionPick two numbersai,aj(i≠j)from a sequence to maximize the value of their greatest common divisor.InputMultiple test cases. In the f...
阅读全文
摘要:Description已知一个圆的圆周被N个点分成了N段等长圆弧,求任意取三个点,组成锐角三角形的个数。Input多组数据。每组数据一个N (N ≤ 1000000)。Output对于每组数据,输出不同锐角三角形的个数。Sample Input345Sample Output105大意:数学推导,分...
阅读全文
摘要:Problem DescriptionAfter enjoying the movie,LeLe went home alone. LeLe decided to build blocks. LeLe has already builtnpiles. He wants to move some bl...
阅读全文
摘要:Description众所周知,我是好人!所以不会出太难的题,题意很简单 给你两个数n和m,问你有多少对正整数对最大公约数是n,最小公倍数是m最后友情提供解题代码(我真是太好人了)void solve(){ long long n, m; scanf("%lld%lld", &n, &m); int...
阅读全文
摘要:DescriptionYou've got arraya[1], a[2], ..., a[n], consisting ofnintegers. Count the number of ways to split all the elements of the array into three c...
阅读全文