![](https://img-blog.csdnimg.cn/20200414014409629.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
ICPC-数论:GCD/LCM
文章平均质量分 78
数论中有关GCD/LCM的题解
海岛Blog
专注于程序设计及其竞赛,专注于集成电路EDA设计
展开
-
HDU5902 GCD is Funny【GCD】
GCD is FunnyTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2577 Accepted Submission(s): 626Problem DescriptionAlex has invented a new game for fun. There are n integers at a board and he perfo原创 2021-08-08 11:28:42 · 151 阅读 · 0 评论 -
HDU5656 CA Loves GCD【GCD+枚举】
CA Loves GCDTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2801 Accepted Submission(s): 982Problem DescriptionCA is a fine comrade who loves the party and people; inevitably she loves GCD (g原创 2021-08-07 19:19:45 · 172 阅读 · 0 评论 -
HDU5223 GCD【LCM】
GCDTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1671 Accepted Submission(s): 662Problem DescriptionIn mathematics, the greatest common divisor (gcd) of two or more integers, when at least原创 2021-08-07 18:57:56 · 169 阅读 · 0 评论 -
HDU5392 Infoplane in Tina Town【LCM】
Infoplane in Tina TownTime Limit: 14000/7000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 2713 Accepted Submission(s): 730Problem DescriptionThere is a big stone with smooth surface in Tina Town. When people go原创 2021-08-06 23:49:13 · 174 阅读 · 0 评论 -
POJ2773 Happy 2006【GCD+枚举】
Happy 2006Time Limit: 3000MS Memory Limit: 65536KTotal Submissions: 17883 Accepted: 6261DescriptionTwo positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9…are all relativ原创 2021-08-03 00:36:53 · 201 阅读 · 0 评论 -
UVA10325 The Lottery【GCD+LCM】
The Sports Association of Bangladesh is in great problem with their latest lottery ‘Jodi laiga Jai’. There are so many participants this time that they cannot manage all the numbers. In an urgent meeting they have decided that they will ignore some numbers原创 2021-06-20 18:51:40 · 158 阅读 · 0 评论 -
HDU5974 LA7726 A Simple Math Problem【GCD】
A Simple Math ProblemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 9457 Accepted Submission(s): 2997Problem DescriptionGiven two positive integers a and b,find suitable X and Y to meet the co原创 2021-03-09 19:28:20 · 161 阅读 · 0 评论 -
UVA10717 POJ1855 ZOJ2379 Mint【GCD+LCM】
MintTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 1726 Accepted: 602DescriptionThe Royal Canadian Mint has commissioned a new series of designer coffee tables, with legs that are constructed from stacks of coins. Each table has four legs,原创 2021-02-25 22:51:02 · 232 阅读 · 0 评论 -
UVA11774 Doom‘s Day【数学规律+GCD】
We all know about the legend of tower of Hanoi. It is said that the world will end after finishing the puzzle. What we don’t know is another legend about when the world will end which is verified by the scientists. It is all about a原创 2021-02-06 00:15:58 · 301 阅读 · 0 评论 -
HDU1722 Cake【GCD】
CakeTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8985 Accepted Submission(s): 4291Problem Description一次生日Party可能有p人或者q人参加,现准备有一个大蛋糕.问最少要将蛋糕切成多少块(每块大小不一定相等),才能使p人或者q人出席的任何一种情况,都能平均将蛋糕分食.Inpu原创 2021-02-03 21:54:42 · 265 阅读 · 1 评论 -
HDU5584 LA7411 LCM Walk【数学规律】
LCM WalkTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3506 Accepted Submission(s): 1836Problem DescriptionA frog has just learned some ...原创 2020-03-24 18:42:49 · 262 阅读 · 0 评论 -
UVA11827 Maximum GCD【GCD】
Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these integers.InputThe first line of input is an integer N (1 < N < 100) that determ...原创 2020-02-28 15:30:12 · 344 阅读 · 0 评论 -
AOJ0005 GCD and LCM【GCD+LCM】
GCD and LCMAizu - 0005Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of givenaandb.InputInput consists of several da...原创 2018-01-06 06:40:28 · 835 阅读 · 0 评论 -
HDU1108 最小公倍数【欧几里得算法】
最小公倍数Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 63333Accepted Submission(s): 34881Problem Description给定两个正整数,计算这两个数的...原创 2017-04-05 11:31:16 · 1343 阅读 · 0 评论 -
UVA11466 Largest Prime Divisor【筛选法】
All integer numbers are divisible by primes. If a number is divisible by more than one prime number,then it obviously has a largest prime divisor. The numbers which do not fall in this category do not...原创 2016-07-28 08:37:38 · 742 阅读 · 0 评论 -
HDU2504 又见GCD【欧几里得算法】
又见GCDTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 22314Accepted Submission(s): 9190Problem Description有三个正整数a,b,c(0<...原创 2016-07-26 20:56:12 · 2138 阅读 · 0 评论 -
HDU1222 Wolf and Rabbit【最大公约数】
Wolf and RabbitTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9138Accepted Submission(s): 4656Problem DescriptionThere i...原创 2016-05-14 16:20:33 · 1631 阅读 · 0 评论 -
HDU6025 Coprime Sequence【前缀GCD+后缀GCD】
Coprime SequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1415Accepted Submission(s): 690Problem DescriptionDo yo...原创 2017-05-25 00:17:01 · 2158 阅读 · 0 评论 -
UVA10892 LCM Cardinality【GCD】
A pair of numbers has a unique LCM but a single number can be the LCM of more than one possible pairs. For example 12 is the LCM of (1, 12), (2, 12), (3,4) etc. For a given positive integer N, the num...原创 2019-03-23 01:07:20 · 308 阅读 · 1 评论 -
UVA11388 GCD LCM【GCD+LCM】
The GCD of two positive integers is the largest integer that divides both the integers without any remainder. The LCM of two positive integers is the smallest positive integer that is divisible by bot...原创 2019-03-23 01:29:44 · 414 阅读 · 0 评论 -
UVA11417 GCD【GCD+欧拉函数】
Given the value of N, you will have to find the value of G. The definition of G is given below: Here GCD(i, j) means the greatest common divisor of integer i and integer j.&n...原创 2019-03-23 08:08:41 · 412 阅读 · 0 评论 -
UVA332 LA5440 Rational Numbers from Repeating Fractions【循环小数转分数+GCD】
A rational number is any which can be written in the form p/q, where p and q are integers. All rational numbers less than 1 (that is, those for which p is less than q) can be expanded into a decimal f...原创 2019-03-20 22:24:02 · 462 阅读 · 0 评论