自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

小堃哥的专栏

写博客:网址链接+名称:oj名+所用算法名称+该题注意事项和心得

  • 博客(16)
  • 资源 (1)
  • 收藏
  • 关注

原创 poj 1050动态规划+最大子矩阵和+二维化为一维来求最大子串和值

/*二维化为一维来求最大子序列值*/#include#includeusing namespace std;int Arr[110][110] = { 0 },N=0,sum1=0,max1=0;void dp(int n){ int a = 0; sum1 += Arr[n][1]; for (a = 2; a <= N; a++) { if (sum1 < 0)

2014-08-30 00:14:06 301

原创 poj 1088+动态规划+记忆化搜索

/*不能找最高点进行搜索1 1 11 0 11 1 1*/#include#includeusing namespace std;int Arr[110][110] = { 0 }, R = 0, C = 0, dp[110][110] = { 0 };//dp存储长度,记忆化搜索int dfs(int row, int colum){ if (dp[row][colum]

2014-08-29 11:58:25 336

原创 poj2533 动态规划+最长上升子序列

#include#includeusing namespace std;int Arr[10000] = { 0 }, dp[10000] = { 0 };int main(){int N = 0, i = 0,j=0,maxlength=0;cin >> N;   for (i = 0; i dp[i] = 1;    for (i = 0; i ci

2014-08-28 19:24:28 339

原创 poj3126广搜、筛选法

#include#include#define N 10000using namespace std;int flag[N + 1] = { 0 }, prime[N + 1] = { 0 },pnum=0,a = 0, b = 0;struct number{int prime,step;}queue[20000];void searchprime(){

2014-08-28 11:22:46 340

原创 筛选法求素数

/*1. 每个合数必有一个最大因子(不包括它本身) ,用这个因子筛选合数  2.对于每一个数i,乘上 小于等于i的最小素因数 的素数,就得到以i为最大因数的合数。  3设有一个数t,只要将 所有以比t小的数为最大因数 的合数筛去,*/

2014-08-28 01:37:01 657

转载 素数的求解

blog.csdn.net/insistgogo/article/details/11594247

2014-08-27 23:54:29 305

原创 poj1321变种8皇后

#include#includeusing namespace std;char Arr[8][8] = { '\0' };int num = 0, k = 0, n = 0, map[8] = { 0 };void dfs(int row, int p){   int a = 0,b=0;if (p == k) {num++;return;}if

2014-08-27 18:54:22 335

原创 八皇后问题

#include#include#includeusing namespace std;int Arr[8][8] = { 0 },num=0;int valid(int h, int v){int x = 0, y = 0;for (x = 0; x {for (y = 0; y {if (Arr[x][y]){if (x == h) re

2014-08-27 00:06:49 345

原创 poj1664+放苹果+递归和动态规划

#include#includeusing namespace std;int dp(int m, int n){if (m == 1 || n == 1||m==0||n==0) return 1;else if (m 0&&n>0)  return dp(m, m);else if(m>=n&&m>0&&n>0)  return dp(m, n - 1) + dp(

2014-08-26 18:55:05 362

转载 归并排序

blog.csdn.net/crcr/article/details/5965454

2014-08-26 14:17:58 298

原创 poj2299+归并排序+注意输出来的那个数据的类型。。。

#include#include#include#includeusing namespace std;int Arr[500005] = { 0 }, temp[500005] = { 0 }, N = 0;__int64 num;void merge(int low,int m, int high){int i = low, j = m + 1,n=0,le

2014-08-26 14:17:28 456

转载 合并排法求逆序数

点击打开链接

2014-08-26 00:50:25 312

转载 逆序法

点击打开链接

2014-08-26 00:47:36 618

转载 快速排序算法

点击打开链接

2014-08-25 23:03:48 328

转载 二十世纪最伟大的十大算法

点击打开链接

2014-08-25 22:41:32 834

原创 poj2388快排

#include#includeusing namespace std;int Arr[10000] = { 0 };void qsort(int Left, int right){ int temp = 0; if (Left >= right) return; if (right - Left == 1){ if (Arr[Left] > Ar

2014-08-25 22:34:17 450

c语言版贪吃蛇

很好的一个源代码,相当不错

2014-01-24

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除