上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: Prim算法(贪心策略)N^2 选定图中任意定点v0,从v0开始生成最小生成树 树中节点Va,树外节点Vb 最开始选一个点为Va,其余Vb, 之后不断加Vb到Va最短距离的点 1.初始化d[v0]=0,其他d[i]=正无穷。d表示Vb电到i的最小距离 2.经过n次如下步骤,得到一颗喊n节点n-1边的 阅读全文
posted @ 2019-02-25 20:31 YFR718 阅读(245) 评论(0) 推荐(0) 编辑
摘要: E. Wrong Answer time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Consider the following pr 阅读全文
posted @ 2019-02-25 01:26 YFR718 阅读(319) 评论(0) 推荐(0) 编辑
摘要: D2. Toy Train time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D2. Toy Train time limit p 阅读全文
posted @ 2019-02-25 01:25 YFR718 阅读(412) 评论(0) 推荐(0) 编辑
摘要: D1. Toy Train (Simplified) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D1. Toy Train 阅读全文
posted @ 2019-02-25 01:24 YFR718 阅读(219) 评论(0) 推荐(0) 编辑
摘要: void kmp_pre(char x[],int m,int next[]){ int i=0,j; j=next[0]=-1; while(i=m){ ans++; j=next[j]; } } return ans; } 阅读全文
posted @ 2019-02-24 23:09 YFR718 阅读(111) 评论(0) 推荐(0) 编辑
摘要: F. Asya And Kittens time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output F. Asya And Kittens 阅读全文
posted @ 2019-02-24 09:14 YFR718 阅读(351) 评论(0) 推荐(0) 编辑
摘要: E. String Multiplication time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Roman and Denis 阅读全文
posted @ 2019-02-24 09:09 YFR718 阅读(346) 评论(0) 推荐(0) 编辑
摘要: D. Gourmet choice time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D. Gourmet choice time 阅读全文
posted @ 2019-02-24 09:01 YFR718 阅读(643) 评论(0) 推荐(0) 编辑
摘要: 1435:【例题3】曲线 【题目描述】 明明做作业的时候遇到了n个二次函数Si(x)= ax2 + bx + c,他突发奇想设计了一个新的函数F(x) = max(Si(x)), i = 1...n. 明明现在想求这个函数在[0,1000]的最小值,要求精确到小数点后四位四舍五入。 【输入】 输入包 阅读全文
posted @ 2019-02-21 16:44 YFR718 阅读(841) 评论(0) 推荐(0) 编辑
摘要: 1434:【例题2】Best Cow Fences 【题目描述】 给定一个长度为n的正整数序列A。求一个平均数最大的,长度不小于L的子序列。 【输入】 第一行,n和L; n个正整数,表示A。 【输出】 一个整数,表示答案的1000倍(不用四舍五入,直接输出)。 【输入样例】 10 6 6 4 2 1 阅读全文
posted @ 2019-02-21 15:57 YFR718 阅读(1034) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页