题目:四平方定理,输出一个数可以表示成不超过四个平方数和的表示方法数。
分析:dp,完全背包。整数拆分用背包,可用一维分步计算,也可统一写成二维。
状态:设f(i,j,k)为前i个数字,取j个数字他们的平方和是k的便是方法数;
转移:f(i,j,k)= sum(f(i-1,j-1,k-i*i));{ 其中i可以省掉不写 };
说明:打表计...
分类:
其他好文 时间:
2014-10-01 20:21:31
阅读次数:
175
简单的暴力筛法就可。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 const int N = 1...
分类:
其他好文 时间:
2014-09-20 15:18:57
阅读次数:
182
就是给出一个等边三角形的三个顶点坐标
然后每个角的三等分线会交错成一个三角形,求出这个三角形的顶点坐标
一开始,我题意理解错了……还以为是任意三角形,所以代码能够处理任意三角形的情况
我的做法:
通过旋转点的位置得到这些三等分线的直线方程,然后用高斯消元求交点
我的代码:
#include
#include
#include
#include
#...
分类:
其他好文 时间:
2014-09-18 18:51:04
阅读次数:
264
Morley’s
Theorem
Input: Standard Input
Output: Standard Output
Morley’s theorem states that that the lines trisecting the angles of an arbitrary plane triangle meet at the vertices of an equilat...
分类:
其他好文 时间:
2014-09-12 15:07:13
阅读次数:
184
Fermat’s Chirstmas Theorem
Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^
题目描述
In a letter dated December 25, 1640; the great mathematician Pierre de Fermat wrote to Marin...
分类:
其他好文 时间:
2014-09-02 10:35:34
阅读次数:
254
不涉及什么算法,只是简单的套用模板进行计算。
如果一个向量进行逆时针旋转,那么可以使用定义的函数 Rotate(v,rad)进行计算。
但是如果进行顺时针旋转,那么需要将rad改为-rad,也就是Rotate(v,-rad)进行计算。
精度的控制为 1e-10;
14112243
11178
Morley's Theorem
Accepted
C...
分类:
其他好文 时间:
2014-08-29 20:08:28
阅读次数:
282
1.Link:http://poj.org/problem?id=30062.Content:Dirichlet's Theorem on Arithmetic ProgressionsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: ...
分类:
其他好文 时间:
2014-08-26 14:57:06
阅读次数:
231
BicoloringIn 1976 the ``Four Color Map Theorem" was proven with the assistance of a computer. This theorem states that every map can be colored using....
分类:
其他好文 时间:
2014-08-15 14:23:23
阅读次数:
195
uva 11178 Morley's Theorem(计算几何-点和直线)
题目大意:
作三角形的每个角的三等分射线,相交成的三角形DEF为等边三角形。
解题思路:
通过向量的旋转以及直线的相交,求出相应的交点。...
分类:
其他好文 时间:
2014-08-13 13:15:26
阅读次数:
203
题目链接题意 : 中文题不详述。思路 : 由N%Mi=(Mi-a)可得(N+a)%Mi=0;要取最小的N即找Mi的最小公倍数即可。 1 //1788 2 #include 3 #include 4 #include 5 #include 6 #define LL long long 7 8...
分类:
其他好文 时间:
2014-08-11 11:37:52
阅读次数:
160