![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法初级
aaayuaaa
这个作者很懒,什么都没留下…
展开
-
深度优先算法———穷竭算法
深度优先搜索从某个状态开始,不断地转移状态回到无法转移,然后退回到前一步状态,继续转移到其他状态,如此反复,直到找到最终解。#include<cstdio>bool dfs(int i,int sum,int *a,int n, int k);int main(){ int n,k; scanf("%d",&n); //数字数量 ...原创 2019-01-31 16:57:54 · 222 阅读 · 0 评论 -
POJ 2386 Lake Counting
Lake CountingDescriptionDue to recent rains, water has pooled in various places in Farmer John’s field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) square...原创 2019-02-25 21:57:40 · 149 阅读 · 0 评论 -
POJ 1979 Red and Black
Red and BlackDescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four a...原创 2019-02-25 21:58:24 · 131 阅读 · 0 评论 -
贪心 POJ3617 Best Cow Line
DescriptionFJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges.The c...原创 2019-03-04 14:05:12 · 128 阅读 · 0 评论 -
POJ 3069 Saruman's Army
DescriptionSaruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the troop...原创 2019-03-04 17:10:05 · 114 阅读 · 0 评论