ACM
文章平均质量分 72
粘锅的咸鱼啊
热爱编程
展开
-
内部收益率
题目描述 在金融中,我们有时会用内部收益率IRR来评价项目的投资财务效益,它等于使得投资净现值NPV等于0的贴现率。换句话说,给定项目的期数T、初始现金流CF0和项目各期的现金流CF1, CF2, ...,CFT,IRR是下面方程的解: 为了简单起见,本题假定:除了项目启动时有一笔投入(即初始现金流CF0 i=1,2,...,T,CFi > 0)。根据定义,IRR可以是原创 2016-12-08 20:49:05 · 2608 阅读 · 0 评论 -
You have a maze with obstacles and non-zero digits in it
You can start from any square, walk in the maze, and finally stop at some square. Each step, you may only walk into one of the four neighbouring squares (up, down, left, right) and you cannot walk in原创 2016-12-08 15:15:10 · 561 阅读 · 0 评论 -
区间覆盖问题
用i来表示x轴上坐标为[i-1,i]的区间(长度为1),并给出M(1≤M≤200)个不同的整数,表示M个这样的区间。 现在让你画几条线段覆盖住所有的区间,条件是:每条线段可以任意长,但是要求所画线段的长度之和最小,并且线段的数目不超过N(1≤N≤50)。 输入 5 3 1 3 4 7 11 输出 6 分析: 输入 5 3原创 2016-12-16 15:22:48 · 461 阅读 · 0 评论 -
时间序列问题
已知N个时间的发生时刻和结束时刻(见下表)。一些在时间上没有重叠的事件,可以构成一个事件序列,如事件{ 2,8,10 }。 事件序列包含的事件数目,称为该事件序列的长度。请编程找出一个最长事件序列 up主这里为了让输入方便一点 就用文件的方式 读取数据 文件名:1.txt 0 1 3 1 3 4 2 0 7 3 3 8 4 2 9 5 5 10原创 2016-12-15 15:40:32 · 2029 阅读 · 0 评论 -
最大流算法
如图 求出Us 到 Ut 的最大流: 我的思路:用dfs寻找增广链 我的方法如下: 文件:1.txt 0 1 5 0 2 4 0 3 3 1 4 5 1 5 3 2 5 3 2 6 2 3 6 2 4 7 4 5 7 3 6 7 4我的代码: #include #include using namespace std; const int n=8; //0~7原创 2016-12-27 14:14:16 · 644 阅读 · 1 评论 -
最短路径
#include #include using namespace std; int main(int argc, const char * argv[]) { int a[10][10],n,m,i,j; int x,y,val; int vals[10]; int cf[10]; int inf=999999; //n 表示 多少点 m表示多原创 2017-06-10 17:08:35 · 202 阅读 · 0 评论 -
A. Flipping Game DP水题
A. Flipping Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Iahub got bored, so he invented a game to b原创 2017-06-24 12:03:06 · 871 阅读 · 0 评论