会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Hutonm
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
下一页
2016年5月15日
prime
摘要: #include <stdio.h> #include <string.h> #define MaxInt 0x3f3f3f3f
阅读全文
posted @ 2016-05-15 21:42 Hutonm
阅读(251)
评论(0)
推荐(0)
2016年5月10日
POJ-2564 01背包问题
摘要: 1 #include"cstdio" 2 #include"cstring" 3 #include"algorithm" 4 using namespace std; 5 int n;//菜的数量 6 int greens[1000+5]; 7 int m;//卡上余额 8 int main(){ 9 while(scanf("%d",&n)==1&&n){//输入菜...
阅读全文
posted @ 2016-05-10 20:00 Hutonm
阅读(638)
评论(0)
推荐(0)
POJ-1564 dfs
摘要: 1 #include"cstring" 2 #include"cstdio" 3 const int maxn=100+5; 4 int nux[maxn]; 5 int nua[maxn];//解的集合 6 int t;//t为和 7 int n;//n为元素个数 8 bool flag;//判断是否有解 9 void dfs(int sum,int...
阅读全文
posted @ 2016-05-10 14:16 Hutonm
阅读(122)
评论(0)
推荐(0)
2016年5月9日
poj-1979 dfs
摘要: 1 #include"cstring" 2 #include"cstdio" 3 const int maxn=20+5; 4 char tile[maxn][maxn];//方块格子 5 int m,n,idx[maxn][maxn];//m行n列 ,idx判断是否访问过 6 int a[]={-1,0,1,0}; 7 int b[]={0,-1,0,1};//移动 8 ...
阅读全文
posted @ 2016-05-09 18:58 Hutonm
阅读(136)
评论(0)
推荐(0)
poj-2531
摘要: 1 #include"iostream" 2 #include"cstring" 3 using namespace std; 4 #define MAXN 20+5 5 int C[MAXN][MAXN]; 6 int vis[MAXN]; 7 int N; 8 int ans; 9 void dfs(int id,int data){ 10 vis[id]=1; 1...
阅读全文
posted @ 2016-05-09 12:15 Hutonm
阅读(162)
评论(0)
推荐(0)
2016年5月8日
POJ-1753
摘要: 题目链接:http://poj.org/problem?id=1753 题目概述:有4*4的正方形,每个格子要么是黑色,要么是白色,当把一个格子的颜色改变(黑->白或者白->黑)时,其周围上下左右(如果存在的话)的格子的颜色也被反转,问至少反转几个格子可以使4*4的正方形变为纯白或者纯黑?
阅读全文
posted @ 2016-05-08 20:42 Hutonm
阅读(325)
评论(0)
推荐(0)
NYOJ-127 快速求幂,最小生成树
摘要: 1 #include"iostream" 2 using namespace std; 3 int kuaisuqiumo(int a,int b,int c){ 4 int ans = 1; 5 a = a % c; 6 while(b>0){ 7 if(b % 2 == 1) 8 ans = (ans * a) ...
阅读全文
posted @ 2016-05-08 20:41 Hutonm
阅读(177)
评论(0)
推荐(0)
NYOJ-115 Dijlstra
摘要: 原题链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=115
阅读全文
posted @ 2016-05-08 20:38 Hutonm
阅读(280)
评论(0)
推荐(0)
2016年4月25日
快速求幂
摘要: 快速幂在算指数时是很高效的,他的基本原理是二进制。 如果要算 2^5,可以直接2*2*2*2*2 但是如果要算 3^999,指数N太大,计算太慢,所以有一种快速的解法。 @@@@@@@@@@@@@@@@@@@@@@@@ 以3^21为例。 2^21=(2^16)×(2^4)×(2^1) 21的二进制可
阅读全文
posted @ 2016-04-25 22:53 Hutonm
阅读(826)
评论(0)
推荐(0)
2016年4月22日
图的数据结构实现
摘要: 1 #include"iostream" 2 #include"malloc.h" 3 #include"queue" 4 using namespace std; 5 #define MAX 50 6 typedef struct node{ 7 int adjvex; //拎接点域 8 struct node *next; //链域 ...
阅读全文
posted @ 2016-04-22 00:25 Hutonm
阅读(272)
评论(0)
推荐(0)
上一页
1
2
3
4
5
下一页
公告