Tag：greatest common divisor

Time：20211017
Online maximum common factor calculator Online maximum common factor calculator The tool can calculate the maximum common factor of 2 given numbers, which is calculated by pure client. The greatest common factor, also known as the greatest common divisor and the greatest common factor, refers to the largest of the common divisors of two or […]

Time：20211011
Basic data structure and algorithm of hand golang Euclidean algorithm of maximum common divisor / rolling Division origin Recently read < < my first algorithm book > > ([Japan] Ishida Baohui; Miyazaki Xiuyi)This series of notes is intended to use golang exercises Euclidean algorithm Euclidean algorithm (also known as rolling Division) is used to calculate […]

Time：202132
Title: card grouping Given a deck of cards, an integer is written on each card. At this point, you need to select a number x, so that we can divide the whole deck into one or more groups according to the following rules: Each group has X cards.All cards in the group have the same […]

Time：2021117
ring Integer ringZ_mIt consists of the following two parts: 1. AssemblyZ_m = ( 0,1,2,…,m )2. Two kinds of operations “+” and “X” make thea, b\in Z_myes: a + b\equiv c\ mod\ m, (c\in Z_m)\\ a\times b\equiv d\ mod\ m, (d\in Z_m) Key features of rings If the result of the addition or multiplication of any […]

Time：20201120
The maximum number of points on a line difficultydifficulty Given a twodimensional plane, there are n points on the plane, find the maximum number of points on the same line. Example 1:Input: [[1,1],[2,2],[3,3]]Output: 3Explanation: Example 2:Input: [[1,1],[3,2],[5,3],[4,1],[2,3],[1,4]]Output: 4Explanation: thinking First, you need to make sure that two points are on a straight line – that […]

Time：2020112
Recently, I went to an interview and met several companies. I deeply realized that the more basic the problem is, the more important it is. The more I can investigate a person’s technical skills and logical thinking. Like what we’re going to say nextFind the greatest common divisor of two numbersThe problem. This kind of […]

Time：20201019
Title:Enter two positive integers m and N to find the greatest common divisor and the least common multiple. Program analysis: (1) The least common multiple = the product of two input numbers divided by their greatest common divisor, the key is to find the greatest common divisor; (2) To find the greatest common divisor by […]

Time：202063
Example 10 maximum common divisor Problem description There are three positive integers a, B, C (0 input data Enter a n n in the first row to indicate that there are n groups of test data, and enter two positive integers a and B in the next n rows. Output format Output the corresponding C, […]

Time：2020311
I. circulation Input a number and output several digits #include int main() { int x; int n = 0; scanf(“%d” , &x); n++; x /= 10; while(x > 0){ n++; x /= 10; } printf(“%d\n”,n); return 0; } 2、 While loop The circulatory body should have the opportunity to change the conditions and avoid the […]