• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
FightingForWorldFinal
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 ··· 6 7 8 9 10
2013年7月8日
HDUOJ 1879继续畅通工程(并查集)
摘要: 1 #include 2 #include 3 using namespace std; 4 struct home 5 { 6 int a; 7 int b; 8 int dis; 9 int _Construct;10 }v[5008];11 int father[200];12 int sum=0;13 int cmp(const void *a,const void *b)14 {15 struct home *c,*d;16 c=(struct home *)a;17 d=(struct home *)b;18 re... 阅读全文
posted @ 2013-07-08 21:02 Sky-J 阅读(197) 评论(0) 推荐(0)
qsort和sort实验程序
摘要: #define inandout#include #include #include #include #include #include #include #include #include #includeusing namespace std ;#define Max 10000000int cmp(const void*a,const void* b)//这里实现了多维数组排序,其实有结构体了无所谓{int c=*((int *)a+1);int d=*((int *)b+1);return c-d;}int node[Max+1][3]={{1,2,3},{2,3,3},{8,5,0 阅读全文
posted @ 2013-07-08 21:00 Sky-J 阅读(221) 评论(0) 推荐(0)
大数类
摘要: #define inandoutn#include #include #include #include #include #include #include #include #include using namespace std ;const int IntegerLen=1000;class Integer{public:Integer(int num=0)//利用整数初始化 有待改进 {if(num=10){result[i]-=10;result[i+1]++;}}result.sign=(*this).sign;}else result=(*this)-(-another);r. 阅读全文
posted @ 2013-07-08 20:57 Sky-J 阅读(286) 评论(0) 推荐(0)
POJ 1088 滑雪 记忆化搜索
摘要: #include using namespace std;int row ,col;int matrix[105][105]={0};// 保存原始数据int cnt[105][105]={0}; // 记录每一个点的最大滑雪长度int DP(int i, int j){int max = 0;// 如果已经处理过,直接返回(记忆化搜索效率之所以高的原因:不重复计算)if (cnt[i][j] > 0) {return cnt[i][j];}// 以下四块语句,只对合法的i和j,进行递归(递归的重点就是:剪去所有不合法的,只处理所有合法的!!!)if (j-1 >= 0){if ( 阅读全文
posted @ 2013-07-08 20:32 Sky-J 阅读(253) 评论(0) 推荐(0)
HDUOJ 3790 最短路代码分析spfa和Dijstra
摘要: #include #include #include #define INF 10000000using namespace std;struct node{ int dis,cost;};struct path{ int value,cost;};node lowcost[1005];bool inQueue[1005];path road[1005][1005];int main(){ int N,M; while(scanf("%d%d",&N,&M),N!=0&&M!=0) { if(N==0 && M==0) bre 阅读全文
posted @ 2013-07-08 20:21 Sky-J 阅读(548) 评论(0) 推荐(0)
2013年4月16日
dp问题状态转移方程总结
摘要: 1(最长公共子串(注意和最长公共子序列区别))两个字符串str1和str2,长度分别为(l1,l2)dp[i][j]表示以两个字符串分别以第i和第j个字符结尾所能达到的公共子序列的长度,由于下面涉及到i-1和j-1,那么这个时候我们一般从i=1和j=1开始到i 0且j> 0 且ch1[i-1]= ch2[j-1]; dp[i][j]= 0; i > 0且j> 0 且ch1[i-1]!= ch2[j-1];注意dp[i][0]=0(0 0且j> 0 且ch1[i-1]= ch2[j-1]; dp[i][j]= max {dp[i-1][j] , dp[i][j-1]};i 阅读全文
posted @ 2013-04-16 22:13 Sky-J 阅读(604) 评论(0) 推荐(0)
2013年3月27日
欢迎光临我的博客!
摘要: 第一篇就不说什么了,呵呵~ 阅读全文
posted @ 2013-03-27 19:13 Sky-J 阅读(208) 评论(1) 推荐(0)
上一页 1 ··· 6 7 8 9 10
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3