
GCD
文章平均质量分 60
luer9
假如我年少有为。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU-1717 小数转换成分数 运用GCD
Ray 在数学课上听老师说,任何小数都能表示成分数的形式,他开始了化了起来,很快他就完成了,但他又想到一个问题,如何把一个循环小数化成分数呢? 请你写一个程序不但可以将普通小数化成最简分数,也可以把循环小数化成最简分数。 Input 第一行是一个整数N,表示有多少组数据。 每组数据只有一个纯小数,也就是整数部分为0。小数的位数不超过9位,循环部分用()括起来。 Output ...原创 2018-01-22 19:19:55 · 429 阅读 · 0 评论 -
GCD
#include #include using namespace std; int Gcd(int x,int y) { //return y ? Gcd(y,x%y) : x; while(y) { int temp=x; x=y; y=temp%y; } return x; } int mai原创 2018-01-22 20:17:51 · 182 阅读 · 0 评论 -
CodeForces - 858A 寒假练习
For a given positive integer n denote its k-rounding as the minimum positive integerx, such that x ends with k or more zeros in base 10 and is divisible by n. For example, 4-rounding of 375 is 375·原创 2018-01-23 20:07:15 · 312 阅读 · 0 评论 -
HDU - 2685 寒假训练 gcd的性质 快速幂
To think of a beautiful problem description is so hard for me that let's just drop them off. :) Given four integers a,m,n,k,and S = gcd(a^m-1,a^n-1)%k,calculate the S. InputThe first line co原创 2018-01-23 20:11:41 · 286 阅读 · 0 评论 -
codeforces 803C Maximal GCD
C. Maximal GCDtime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputYou are given positive integer number n. You should create such strictly increasi...转载 2018-05-08 00:03:35 · 195 阅读 · 0 评论 -
HDU 1014 Uniform Generator
Uniform GeneratorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 33113 Accepted Submission(s): 13135Problem DescriptionComputer simulations o...原创 2018-07-14 16:17:52 · 159 阅读 · 0 评论 -
Codeforces Global Round 1 C. Meaningless Operations
题目链接 题目大意: 给定一个a(2 ≤ a ≤2^25−1),找到一个b(0<b<a),求得最大GCD(a^b,a&b); 看了别人的题解好久才明白过来, 果然……这个世界本来就应该是二进制的世界。 ①、当 a≠ (1<<k)-1 ,我们总能找到一个 b 使得 a^b==(1<<k)-1 a&b=0 ,此时gcd为最大 ②、当a==...原创 2019-02-09 23:17:06 · 196 阅读 · 0 评论