![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
爱上键盘的小哥哥
这个作者很懒,什么都没留下…
展开
-
Area of a Parallelogram
A parallelogram is a quadrilateral with two pairs of parallel sides. See the picture below:Fig: a parallelogramNow you are given the co ordinates of A, B and C, you have to find the coordinates原创 2017-10-03 15:07:15 · 447 阅读 · 2 评论 -
2018中国大学生程序设计竞赛 - 网络选拔赛 Find Integer(勾股数)
Problem Descriptionpeople in USSS love math very much, and there is a famous math problem .give you two integers n,a,you are required to find 2 integers b,c such that an+bn=cn. Inputone li...原创 2018-08-27 15:46:51 · 230 阅读 · 0 评论 -
Detachment HDU - 5976(贪心+逆元+二分)
In a highly developed alien society, the habitats are almost infinite dimensional space.In the history of this planet,there is an old puzzle.You have a line segment with x units’ length representing...原创 2018-07-21 20:34:19 · 214 阅读 · 0 评论 -
A Simple Math Problem HDU - 5974 (数学)
Given two positive integers a and b,find suitable X and Y to meet the conditions: X+Y=a Least Com...原创 2018-07-21 16:55:55 · 181 阅读 · 0 评论 -
1005D. Polycarp and Div 3(同余)
Polycarp likes numbers that are divisible by 3.He has a huge number s. Polycarp wants to cut from it the maximum number of numbers that are divisible by 3. To do this, he makes an arbitrary number of ...原创 2018-07-11 21:19:35 · 791 阅读 · 0 评论 -
GCD Expectation ZOJ - 3868(暴力求解)
Edward has a set of n integers {a1, a2,...,an}. He randomly picks a nonempty subset {x1, x2,…,xm} (each nonempty subset has equal probability to be picked), and would like to know the expectation of [...原创 2018-04-25 16:51:56 · 209 阅读 · 0 评论 -
Mistwald ZOJ - 3497 (矩阵快速幂)
In chapter 4 of the game Trails in the Sky SC, Estelle Bright and her friends are crossing Mistwald to meet their final enemy, Lucciola. Mistwald is a mysterious place. It consists of M * N sc...原创 2018-04-21 16:44:54 · 183 阅读 · 0 评论 -
Divisiblity of Differences
You are given a multiset of n integers. You should select exactly k of them in a such way that the difference between any two of them is divisible by m, or tell that it is impossible.Numbers can be re...原创 2018-04-20 19:46:48 · 178 阅读 · 0 评论 -
Modular Inverse ZOJ - 3609 (拓展欧几里得)
The modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equivalent to ax≡1 (mod m). Input There are ...原创 2018-04-23 14:37:52 · 369 阅读 · 0 评论 -
欧几里德算法
转自:http://www.cnblogs.com/frog112111/archive/2012/08/19/2646012.html欧几里德算法又称辗转相除法,用于计算两个整数a,b的最大公约数。基本算法:设a=qb+r,其中a,b,q,r都是整数,则gcd(a,b)=gcd(b,r),即gcd(a,b)=gcd(b,a%b)。第一种证明: a可以表示成a = kb + r,则r =...原创 2018-04-23 11:17:25 · 1171 阅读 · 0 评论 -
Sum
Input 2 Output 2 Hint 1. For N = 2, S(1) = S(2) = 1.2. The input file consists of multiple test cases. 转自点...原创 2018-04-09 12:05:47 · 345 阅读 · 0 评论 -
922B. Magic Forest
Imp is in a magic forest, where xorangles grow (wut?) A xorangle of order n is such a non-degenerate triangle, that lengths of its sides are integers not exceeding n, and the xor-sum of the lengths is...原创 2018-02-12 14:21:57 · 341 阅读 · 0 评论 -
922C - Cave Painting
Imp is watching a documentary about cave painting. Some numbers, carved in chaotic order, immediately attracted his attention. Imp rapidly proposed a guess that they are the remainders of division of ...原创 2018-02-12 15:54:30 · 403 阅读 · 0 评论 -
1029D. Concatenated Multiples(思维+数学)
You are given an array a, consisting of npositive integers.Let's call a concatenation of numbers xand y the number that is obtained by writing down numbers x and y one right after another withou...原创 2018-09-02 16:21:21 · 481 阅读 · 1 评论