1.数列(seq2.pas/c/cpp)题目描述一个数列定义如下:f(1) = 1,f(2) = 1,f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7。给定 A,B 和 n 的值,要求计算 f(n)的值。输入格式仅一行包含 3 个整数 A,B 和 n,其中(1≤ ...
分类:
其他好文 时间:
2014-09-14 20:34:37
阅读次数:
223
The Triangle http://poj.org/problem?id=1163暴力dfs的话,每个节点有两条路可以走,那么n个节点复杂度就是2^n n=100 超时 dp来做 就优化成 n^2记忆化搜索,就能优化成n^2 因为一个点最多算一次,以后会直接返回dp i j 。 dp i j ....
分类:
其他好文 时间:
2014-09-14 11:19:27
阅读次数:
185
有个以坐标原点为圆心的圆,给出圆上的点的关于x轴的夹角,以及圆的半径,求圆上点所能构成的三角形的面积和
我的做法:
先算出每个点的坐标,枚举所有三个点的组合,叉积求面积
我的代码:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
usi...
分类:
其他好文 时间:
2014-09-12 22:12:14
阅读次数:
235
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
Triangle
Total Accepted: 17536 Total
Submissions: 65508My Submissions
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row...
分类:
其他好文 时间:
2014-09-11 07:42:01
阅读次数:
194
1 public class Solution { 2 public List getRow(int rowIndex) { 3 List result = new ArrayList(); 4 for (int i=0; i=0; j--) { 6 ...
分类:
其他好文 时间:
2014-09-10 21:02:51
阅读次数:
180
Delphi XE7已经内建了蓝牙功能,提供了System.Bluetooth.pas单元顾名思义,System表示XE7的蓝牙功能可以在Windows,Android,IOS系统内使用System.Bluetooth单元中主要包含一下几个类TBluetoothManagerTBluetoothDe...
分类:
其他好文 时间:
2014-09-10 19:30:41
阅读次数:
350
一、Delphi中各种文件的介绍,及其关系。OXC: ActiveX控件。会被安装到某一个组件包DPK中,在Imports中会创建PAS、DCU、DCR三个文件。DLL: 动态链接库文件,它的Exports exports既可以写在工程文件里面,也可以写在Unit里面,没有区别。DPK: 组件包文件...
分类:
其他好文 时间:
2014-09-09 18:12:29
阅读次数:
340
Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(...
分类:
其他好文 时间:
2014-09-09 15:07:48
阅读次数:
167