题意:若三边长 { a , b , c } 均为整数的直角三角形周长为 p ,当 p = 120 时,恰好存在三个不同的解:{ 20 , 48 , 52 } , { 24 , 45 , 51 } , { 30 , 40 , 50 } 在所有的p ≤ 1000中,p取何值时有解的数目最多? 思路:可以构建素勾股数,每构建成功一组素勾股数就用其生成其他勾股数,最后扫描一遍取最大值即可. 素勾股数性质: /************************************************…
Find Integer Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 6597    Accepted Submission(s): 1852Special Judge Problem Description people in USSS love math very much, and there is a famous math…
If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120. {20,48,52}, {24,45,51}, {30,40,50} For which value of p ≤ 1000, is the number of solutions maximised? #include <iostre…
Right triangles with integer coordinates The points P (x1, y1) and Q (x2, y2) are plotted at integer co-ordinates and are joined to the origin, O(0,0), to form ΔOPQ. There are exactly fourteen triangles containing a right angle that can be formed whe…
Almost equilateral triangles It is easily proved that no equilateral triangle exists with integral length sides and integral area. However, the almost equilateral triangle 5-5-6 has an area of 12 square units. We shall define an almost equilateral tr…
If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120. {20,48,52}, {24,45,51}, {30,40,50} For which value of p  1000, is the number of solutions maximised? 题目大意: 如果p是一个直角三角形…
传送门 做出一个好几个星期屯下来的题目的感觉就是一个字: 爽! 上图的黄点部分就是我们需要求的点 两边的部分很好算 求圆的地方有一个优化,由于圆心是整数点,我们可以把圆分为下面几个部分,阴影部分最难算,最后乘就好了 代码如下所示 #include <bits/stdc++.h> using namespace std; const int MAXN = 2005; const int INF = 0x3f3f3f3f; typedef long long ll; typedef long do…
题目描述: 一组勾股数满足:a2+b2=c2: 素勾股数:a,b,c彼此互质. 输入正整数N: 输出小于等于N的数中有多少组勾股数. 例: 输入:10 输出:1 思路:我是直接暴力破解的…… 首先找出勾股数,再判断是不是素勾股数.(如果N较大,注意定义成int可能超范围,当然N很大时就不能用暴力破解法了……) 代码: #include <vector> #include <iostream> using namespace std; bool isr(int a, int b);…
题意:三个正整数a + b + c = 1000,a*a + b*b = c*c.求a*b*c. 解法:可以暴力枚举,但是也有数学方法. 首先,a,b,c中肯定有至少一个为偶数,否则和不可能为以上两个等式均不会成立.然后,不可能a,b为奇c为偶,否则a*a%4=1, b*b%4=1, 有(a*a+b*b) %4 = 2,而c*c%4 = 0.也就是说,a和b中至少有一个偶数. 这是勾股数的一个性质,a,b中至少有一个偶数. 然后,解决过程见下(来自project euler的讨论): tag:m…
In Problem 42 we dealt with triangular problems, in Problem 44 of Project Euler we deal with pentagonal number, I can only wonder if we have to deal with septagonal numbers in Problem 46. Anyway the problem reads Pentagonal numbers are generated by t…