算法分析
tobe_numberone
黑龙江科技大学在读本科生
展开
-
贪心算法 poj3617 Best Cow Line
题目链接:http://poj.org/problem?id=3617 大概的中文意思: 比较好的一种思路,令输入的序列为s1,s1的反转的序列为s2; 按照字符串的比较来比较s1和s2的大小,若s1!=s2 则取小的那一个的首字母加入到T序列 若s1 == s2 则默认取s1的首字母加入到T序列。取谁的首字母,谁就往后移动一步。 ...原创 2019-04-20 19:48:59 · 218 阅读 · 0 评论 -
贪心算法 poj3069 Saruman's Army
题目链接:http://poj.org/problem?id=3069 中文大概意思: 思路: 代码: #include <iostream> #include <algorithm> using namespace std; int data[1010]; int fun(int R,int nums); int main(){ int R,nums; ...原创 2019-04-20 20:55:00 · 362 阅读 · 0 评论 -
贪心算法 poj3253 Fence Repair
题目链接:http://poj.org/problem?id=3253 中文大概意思: 思路: 示例: 代码: #include <iostream> #include <algorithm> #include <queue> using namespace std; priority_queue<int,vector<int>,gre...原创 2019-04-20 21:29:32 · 216 阅读 · 0 评论 -
记忆化搜索 hdu oj2602 Bone Collector 01背包问题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602 中文题目: 思路: 代码: #include <iostream> #include <algorithm> using namespace std; int recode[1000][1000]{0}; int value[1000];//价值 int v[100...原创 2019-04-21 11:27:52 · 202 阅读 · 0 评论