• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

  • 联系
  • 订阅
  • 管理
上一页 1 2 3 4 5 6 7 8 9 10 11 下一页

2010年12月14日

HDU 2084数塔 dp

摘要: //记忆化搜索//从最底层开始向上搜索,每次保存最大的值#include<iostream>#define MAX 101using namespace std;int a[MAX][MAX];int main(){ int cases; int height; cin >> cases; int c[MAX]; int b[MAX]; while (cases--) { ... 阅读全文

posted @ 2010-12-14 19:46 sysuwhj 阅读(374) 评论(1) 推荐(0)

sicily 1135 飞越原野 bfs

摘要: 这题因为两个地方打错变量,WA了好几次。 阅读全文

posted @ 2010-12-14 15:48 sysuwhj 阅读(493) 评论(0) 推荐(0)

2010年12月12日

sicily 1001. Alphacode dp

摘要: 看了动态规划,对dp有个大概理解,这题之前一直卡着,刚开始还用搜索做~ 要注意对0的处理,开始把方程列错,WA数次 dp方程为 a[n] = a[n-1]+a[n-2],输入的字符串一次为X1X2X3…Xn… 当Xn = 0时,a[n] = a[n-2] 当Xn != 0时, 若X(n-1)与X(n)组成的数大于26, a[n] = a[n-1]. 若X(n-1)与X(n)组成的数=... 阅读全文

posted @ 2010-12-12 23:20 sysuwhj 阅读(1033) 评论(0) 推荐(0)

sicily 1159. Sum 高精度加法

摘要: #include <iostream>#include <string.h>#define MAX 1005using namespace std;char result[MAX];char a[MAX];char b[MAX];int result_size;void add();int main(){ int n; while (cin >> n) { c... 阅读全文

posted @ 2010-12-12 23:19 sysuwhj 阅读(670) 评论(0) 推荐(0)

2010年12月10日

sicily 1791 Philia's Problem

摘要: 运用蔡勒公式,注意取模用法~~~w = (w%7+7)%7 因为这个WA了好几次 #include iostream#include stdio.husing namespace std; int main(){ int y, m, d, c, w; int re_d, re_m, re_y; int cases; int interval; int month[13] = {0, 3... 阅读全文

posted @ 2010-12-10 22:44 sysuwhj 阅读(273) 评论(0) 推荐(0)

sicily 1790. Single Round Match

摘要: 很简单一道题,高精度判断能否被11整除, WA了好几次,发现输入0 0 时原来要输出YES~ 阅读全文

posted @ 2010-12-10 21:12 sysuwhj 阅读(405) 评论(0) 推荐(0)

sicily 1796. Max's kingdom

摘要: 刚开始还打算用map,后来发现,按x第一关键字, y第二关键字排序即可, 感觉有点像基数排序#include <iostream>#include <stdio.h>#include <algorithm>using namespace std;#define MAX 1000000struct per{ long x,y;};per num[MAX];boo... 阅读全文

posted @ 2010-12-10 19:48 sysuwhj 阅读(215) 评论(0) 推荐(0)

2010年12月9日

sicily 1031. Campus 单源最短路

摘要: 这题做得无比纠结~~~WA了无数次,一开始以为算法错了, 调了半天发现不了问题, 最后还是看别人解题报告才过, 原来当输入的S和T不在列表且S=T时,是要输出0的,这个要注意~~ 主要是用一个map把字符串映射到数字#include <iostream>#include <string>#include <map>#include <memory.h>#define INF 1000000#define MAX 210using namespace std;int cost[MAX][MAX];int my_distance[MAX];bool 阅读全文

posted @ 2010-12-09 19:06 sysuwhj 阅读(1359) 评论(3) 推荐(2)

2010年12月8日

sicily 1024 Magic Island dfs

摘要: 这题就是个杯具~~~简单的dfs, WA了无数次,后来发现是因为每次cases忘了重新把vector数组clear掉,晕死~~~ 阅读全文

posted @ 2010-12-08 14:27 sysuwhj 阅读(1204) 评论(0) 推荐(0)

HDOJ 1102 Constructing Roads 最小生成树

摘要: //Prim算法#include <iostream>#include <memory.h>#define INF 1000000#define MAX 200using namespace std;int main(){ int arcs[MAX][MAX]; bool isvisit[MAX]; int min_weight[MAX]; int N, Q; int x,... 阅读全文

posted @ 2010-12-08 12:07 sysuwhj 阅读(392) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 9 10 11 下一页
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3