贪心-暴破-枚举
贪心-暴破-枚举
master-dragon
weixin:dwl_1270530306
展开
-
猜数字 -- 暴力法
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1172/* 猜数字 http://acm.hdu.edu.cn/showproblem.php?pid=1172 */ #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <al原创 2015-09-04 15:59:24 · 561 阅读 · 0 评论 -
扫描透镜-贪心-动归
题目描述在N*M的草地上,提莫种了K个蘑菇,蘑菇爆炸的威力极大,兰博不想贸然去闯,而且蘑菇是隐形的.只 有一种叫做扫描透镜的物品可以扫描出隐形的蘑菇,于是他回了一趟战争学院,买了2个扫描透镜,一个 扫描透镜可以扫描出(3*3)方格中所有的蘑菇,然后兰博就可以清理掉一些隐形的蘑菇. 问:兰博最多可以清理多少个蘑菇? 注意:每个方格被扫描一次只能清除掉一个蘑菇。 输入描述: 第一行三个整数:N,原创 2016-08-16 10:14:39 · 524 阅读 · 0 评论 -
等差数列
题目描述 Description 给定n(1<=n<=100)个数,从中找出尽可能多的数使得他们能够组成一个等差数列.求最长的等差数列的长度.输入描述 Input Description 第一行是一个整数n,接下来一行包括了n个数,每个数的绝对值不超过10000000.输出描述 Output Description 对于每个输入数据,输出你所找出的最长等差数列的长度样例输入 Sample In原创 2015-08-28 15:45:36 · 874 阅读 · 0 评论 -
55. Jump Game (leetcode)
题目地址 https://leetcode.com/problems/jump-game/题目描述Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum原创 2016-10-04 18:57:51 · 275 阅读 · 0 评论 -
1096. Consecutive Factors (20) (暴力法)
转载地址 http://www.cnblogs.com/asinlzm/p/4460935.html题目地址 https://www.patest.cn/contests/pat-a-practise/1096ac代码#include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <iostrea转载 2016-12-04 10:13:14 · 327 阅读 · 0 评论 -
1045. Favorite Color Stripe (30),需要抽象问题
题目地址https://www.patest.cn/contests/pat-a-practise/1045题目描述Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting原创 2016-11-26 13:50:54 · 459 阅读 · 0 评论